webpackJsonp([6, 4], {
    824 : function(t, e, r) { (function(t) {
            "use strict";
            function i(t) {
                return t && t.__esModule ? t: {
                default:
                    t
                }
            }
            var n = r(30),
            o = i(n),
            a = r(58),
            s = i(a),
            h = r(267),
            l = i(h); (function() {
                var i, n, a, h, c, u, g, d, f, p, x, m, v, b, y, w, D, R, T, C, E, _, S, F, A, P, B = [].indexOf ||
                function(t) {
                    for (var e = 0,
                    r = this.length; e < r; e++) if (e in this && this[e] === t) return e;
                    return - 1
                },
                M = [].slice,
                I = {}.hasOwnProperty,
                L = function(t, e) {
                    return function() {
                        return t.apply(e, arguments)
                    }
                },
                z = function(t, e) {
                    function r() {
                        this.constructor = t
                    }
                    for (var i in e) I.call(e, i) && (t[i] = e[i]);
                    return r.prototype = e.prototype,
                    t.prototype = new r,
                    t.__super__ = e.prototype,
                    t
                };
                A = ["extended", "included"],
                w = function() {
                    function t() {}
                    return t.extends = function(t) {
                        var e, r, i;
                        for (e in t) r = t[e],
                        B.call(A, e) < 0 && (this[e] = r);
                        return null != (i = t.extended) && i.apply(this),
                        this
                    },
                    t.includes = function(t) {
                        var e, r, i;
                        for (e in t) r = t[e],
                        B.call(A, e) < 0 && (this.prototype[e] = r);
                        return null != (i = t.included) && i.apply(this),
                        this
                    },
                    t.delegate = function() {
                        var t, e, r, i, n, o;
                        for (t = 1 <= arguments.length ? M.call(arguments, 0) : [], r = t.pop(), o = [], i = 0, n = t.length; i < n; i++) e = t[i],
                        o.push(this.prototype[e] = r.prototype[e]);
                        return o
                    },
                    t.aliasFunction = function(t, e) {
                        var r = this;
                        return this.prototype[t] = function() {
                            var t;
                            return t = 1 <= arguments.length ? M.call(arguments, 0) : [],
                            r.prototype[e].apply(r, t)
                        }
                    },
                    t.aliasProperty = function(t, e) {
                        return (0, l.
                    default)(this.prototype, t, {
                            get: function() {
                                return this[e]
                            },
                            set: function(t) {
                                return this[e] = t
                            }
                        })
                    },
                    t.included = function(t) {
                        return t.call(this, this.prototype)
                    },
                    t
                } (),
                i = function(t, r) {
                    return null == r && (r = document),
                    "object" === ("undefined" == typeof t ? "undefined": (0, s.
                default)(t)) || "undefined" != typeof e && null !== e ? t: r.querySelector(t)
                },
                _ = function() {
                    function t() {}
                    return t.uniqid = function() {
                        var t;
                        return t = 0,
                        {
                            get: function() {
                                return t++
                            }
                        }
                    } (),
                    t.extend = function() {
                        var t, e, r, i, n, o, a;
                        for (r = arguments[0], n = 2 <= arguments.length ? M.call(arguments, 1) : [], e = r, o = 0, a = n.length; o < a; o++) {
                            t = n[o];
                            for (i in t) I.call(t, i) && (e[i] = t[i])
                        }
                        return e
                    },
                    t.clampRGB = function(t) {
                        return t < 0 ? 0 : t > 255 ? 255 : t
                    },
                    t.copyAttributes = function(t, e, r) {
                        var i, n, o, a, s, h;
                        for (null == r && (r = {}), a = t.attributes, h = [], n = 0, o = a.length; n < o; n++) i = a[n],
                        null != r.except && (s = i.nodeName, B.call(r.except, s) >= 0) || h.push(e.setAttribute(i.nodeName, i.nodeValue));
                        return h
                    },
                    t.dataArray = function(t) {
                        return null == t && (t = 0),
                        c.NodeJS || null != window.Uint8Array ? new Uint8Array(t) : new Array(t)
                    },
                    t
                } (),
                C = window,
                c = function(e) {
                    function r() {
                        var t, e, i, o = this;
                        if (0 === arguments.length) throw "Invalid arguments";
                        return this instanceof r ? (this.finishInit = this.finishInit.bind(this), this.imageLoaded = this.imageLoaded.bind(this), t = arguments[0], r.NodeJS || (i = parseInt(r.getAttrId(t[0]), 10), e = "function" == typeof t[1] ? t[1] : "function" == typeof t[2] ? t[2] : function() {},
                        isNaN(i) || !E.has(i)) ? (this.id = _.uniqid.get(), this.initializedPixelData = this.originalPixelData = null, this.cropCoordinates = {
                            x: 0,
                            y: 0
                        },
                        this.cropped = !1, this.resized = !1, this.pixelStack = [], this.layerStack = [], this.canvasQueue = [], this.currentLayer = null, this.scaled = !1, this.analyze = new n(this), this.renderer = new T(this), this.domIsLoaded(function() {
                            return o.parseArguments(t),
                            o.setup()
                        }), this) : E.execute(i, e)) : new r(arguments)
                    }
                    return z(r, e),
                    r.version = {
                        release: "4.1.2",
                        date: "7/27/2013"
                    },
                    r.DEBUG = !1,
                    r.allowRevert = !0,
                    r.crossOrigin = "anonymous",
                    r.remoteProxy = "",
                    r.proxyParam = "camanProxyUrl",
                    r.NodeJS = !1,
                    r.autoload = !r.NodeJS,
                    r.toString = function() {
                        return "Version " + r.version.release + ", Released " + r.version.date
                    },
                    r.getAttrId = function(t) {
                        return !! r.NodeJS || ("string" == typeof t && (t = i(t)), null == t || null == t.getAttribute ? null: t.getAttribute("data-caman-id"))
                    },
                    r.prototype.domIsLoaded = function(t) {
                        var e, i = this;
                        return r.NodeJS ? setTimeout(function() {
                            return t.call(i)
                        },
                        0) : "complete" === document.readyState ? (y.debug("DOM initialized"), setTimeout(function() {
                            return t.call(i)
                        },
                        0)) : (e = function() {
                            if ("complete" === document.readyState) return y.debug("DOM initialized"),
                            t.call(i)
                        },
                        document.addEventListener("readystatechange", e, !1))
                    },
                    r.prototype.parseArguments = function(t) {
                        var e, r, i, n;
                        if (0 === t.length) throw "Invalid arguments given";
                        if (this.initObj = null, this.initType = null, this.imageUrl = null, this.callback = function() {},
                        this.setInitObject(t[0]), 1 !== t.length) {
                            switch ((0, s.
                        default)(t[1])) {
                            case "string":
                                this.imageUrl = t[1];
                                break;
                            case "function":
                                this.callback = t[1]
                            }
                            if (2 !== t.length && (this.callback = t[2], 4 === t.length)) {
                                i = t[4],
                                n = [];
                                for (e in i) I.call(i, e) && (r = i[e], n.push(this.options[e] = r));
                                return n
                            }
                        }
                    },
                    r.prototype.setInitObject = function(t) {
                        if (r.NodeJS) return this.initObj = t,
                        void(this.initType = "node");
                        if ("object" === ("undefined" == typeof t ? "undefined": (0, s.
                    default)(t)) ? this.initObj = t: this.initObj = i(t), null == this.initObj) throw "Could not find image or canvas for initialization.";
                        return this.initType = this.initObj.nodeName.toLowerCase()
                    },
                    r.prototype.setup = function() {
                        switch (this.initType) {
                        case "node":
                            return this.initNode();
                        case "img":
                            return this.initImage();
                        case "canvas":
                            return this.initCanvas()
                        }
                    },
                    r.prototype.initNode = function() {
                        return y.debug("Initializing for NodeJS"),
                        "string" == typeof this.initObj && this.initObj.match(/^https?:\/\//) ? this.readFromHttp(this.initObj, this.nodeFileReady) : "string" == typeof this.initObj ? S.readFile(this.initObj, this.nodeFileReady) : this.nodeFileReady(null, this.initObj)
                    },
                    r.prototype.readFromHttp = function(e, r) {
                        var i;
                        return y.debug("Fetching image from " + e),
                        i = F.get(e,
                        function(e) {
                            var i;
                            return i = "",
                            e.setEncoding("binary"),
                            e.on("data",
                            function(t) {
                                return i += t
                            }),
                            e.on("end",
                            function() {
                                return r(null, new t(i, "binary"))
                            })
                        }),
                        i.on("error", r)
                    },
                    r.prototype.nodeFileReady = function(t, e) {
                        if (t) throw t;
                        return this.image = new v,
                        this.image.src = e,
                        y.debug("Image loaded. Width = " + this.imageWidth() + ", Height = " + this.imageHeight()),
                        this.canvas = new g(this.imageWidth(), this.imageHeight()),
                        this.finishInit()
                    },
                    r.prototype.initImage = function() {
                        return this.image = this.initObj,
                        this.canvas = document.createElement("canvas"),
                        this.context = this.canvas.getContext("2d"),
                        _.copyAttributes(this.image, this.canvas, {
                            except: ["src"]
                        }),
                        null != this.image.parentNode && this.image.parentNode.replaceChild(this.canvas, this.image),
                        this.imageAdjustments(),
                        this.waitForImageLoaded()
                    },
                    r.prototype.initCanvas = function() {
                        return this.canvas = this.initObj,
                        this.context = this.canvas.getContext("2d"),
                        null != this.imageUrl ? (this.image = document.createElement("img"), this.image.src = this.imageUrl, this.imageAdjustments(), this.waitForImageLoaded()) : this.finishInit()
                    },
                    r.prototype.imageAdjustments = function() {
                        if (this.needsHiDPISwap() && (y.debug(this.image.src, "->", this.hiDPIReplacement()), this.swapped = !0, this.image.src = this.hiDPIReplacement()), m.isRemote(this.image)) return this.image.src = m.proxyUrl(this.image.src),
                        y.debug("Remote image detected, using URL = " + this.image.src)
                    },
                    r.prototype.waitForImageLoaded = function() {
                        return this.isImageLoaded() ? this.imageLoaded() : this.image.onload = this.imageLoaded
                    },
                    r.prototype.isImageLoaded = function() {
                        return !! this.image.complete && (null == this.image.naturalWidth || 0 !== this.image.naturalWidth)
                    },
                    r.prototype.imageWidth = function() {
                        return this.image.width || this.image.naturalWidth
                    },
                    r.prototype.imageHeight = function() {
                        return this.image.height || this.image.naturalHeight
                    },
                    r.prototype.imageLoaded = function() {
                        return y.debug("Image loaded. Width = " + this.imageWidth() + ", Height = " + this.imageHeight()),
                        this.swapped ? (this.canvas.width = this.imageWidth() / this.hiDPIRatio(), this.canvas.height = this.imageHeight() / this.hiDPIRatio()) : (this.canvas.width = this.imageWidth(), this.canvas.height = this.imageHeight()),
                        this.finishInit()
                    },
                    r.prototype.finishInit = function() {
                        var t, e, i, n, o;
                        if (null == this.context && (this.context = this.canvas.getContext("2d")), this.originalWidth = this.preScaledWidth = this.width = this.canvas.width, this.originalHeight = this.preScaledHeight = this.height = this.canvas.height, this.hiDPIAdjustments(), this.hasId() || this.assignId(), null != this.image && this.context.drawImage(this.image, 0, 0, this.imageWidth(), this.imageHeight(), 0, 0, this.preScaledWidth, this.preScaledHeight), this.imageData = this.context.getImageData(0, 0, this.canvas.width, this.canvas.height), this.pixelData = this.imageData.data, r.allowRevert) for (this.initializedPixelData = _.dataArray(this.pixelData.length), this.originalPixelData = _.dataArray(this.pixelData.length), o = this.pixelData, t = i = 0, n = o.length; i < n; t = ++i) e = o[t],
                        this.initializedPixelData[t] = e,
                        this.originalPixelData[t] = e;
                        return this.dimensions = {
                            width: this.canvas.width,
                            height: this.canvas.height
                        },
                        r.NodeJS || E.put(this.id, this),
                        this.callback.call(this, this),
                        this.callback = function() {}
                    },
                    r.prototype.reloadCanvasData = function() {
                        return this.imageData = this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),
                        this.pixelData = this.imageData.data
                    },
                    r.prototype.resetOriginalPixelData = function() {
                        var t, e, i, n, o, a;
                        if (!r.allowRevert) throw "Revert disabled";
                        for (this.originalPixelData = _.dataArray(this.pixelData.length), o = this.pixelData, a = [], t = i = 0, n = o.length; i < n; t = ++i) e = o[t],
                        a.push(this.originalPixelData[t] = e);
                        return a
                    },
                    r.prototype.hasId = function() {
                        return null != r.getAttrId(this.canvas)
                    },
                    r.prototype.assignId = function() {
                        if (!r.NodeJS && !this.canvas.getAttribute("data-caman-id")) return this.canvas.setAttribute("data-caman-id", this.id)
                    },
                    r.prototype.hiDPIDisabled = function() {
                        return null !== this.canvas.getAttribute("data-caman-hidpi-disabled")
                    },
                    r.prototype.hiDPIAdjustments = function() {
                        var t;
                        if (!r.NodeJS && this.needsHiDPISwap()) return t = this.hiDPIRatio(),
                        1 !== t ? (y.debug("HiDPI ratio = " + t), this.scaled = !0, this.preScaledWidth = this.canvas.width, this.preScaledHeight = this.canvas.height, this.canvas.width = this.preScaledWidth * t, this.canvas.height = this.preScaledHeight * t, this.canvas.style.width = "" + this.preScaledWidth + "px", this.canvas.style.height = "" + this.preScaledHeight + "px", this.context.scale(t, t), this.width = this.originalWidth = this.canvas.width, this.height = this.originalHeight = this.canvas.height) : void 0
                    },
                    r.prototype.hiDPIRatio = function() {
                        var t, e;
                        return e = window.devicePixelRatio || 1,
                        t = this.context.webkitBackingStorePixelRatio || this.context.mozBackingStorePixelRatio || this.context.msBackingStorePixelRatio || this.context.oBackingStorePixelRatio || this.context.backingStorePixelRatio || 1,
                        e / t
                    },
                    r.prototype.hiDPICapable = function() {
                        return null != window.devicePixelRatio && 1 !== window.devicePixelRatio
                    },
                    r.prototype.needsHiDPISwap = function() {
                        return ! (this.hiDPIDisabled() || !this.hiDPICapable()) && null !== this.hiDPIReplacement()
                    },
                    r.prototype.hiDPIReplacement = function() {
                        return null == this.image ? null: this.image.getAttribute("data-caman-hidpi")
                    },
                    r.prototype.replaceCanvas = function(t) {
                        var e;
                        return e = this.canvas,
                        this.canvas = t,
                        this.context = this.canvas.getContext("2d"),
                        r.NodeJS || e.parentNode.replaceChild(this.canvas, e),
                        this.width = this.canvas.width,
                        this.height = this.canvas.height,
                        this.reloadCanvasData(),
                        this.dimensions = {
                            width: this.canvas.width,
                            height: this.canvas.height
                        }
                    },
                    r.prototype.render = function(t) {
                        var e = this;
                        return null == t && (t = function() {}),
                        f.trigger(this, "renderStart"),
                        this.renderer.execute(function() {
                            return e.context.putImageData(e.imageData, 0, 0),
                            t.call(e)
                        })
                    },
                    r.prototype.revert = function(t) {
                        var e, i, n, o, a;
                        if (null == t && (t = !0), !r.allowRevert) throw "Revert disabled";
                        for (a = this.originalVisiblePixels(), e = n = 0, o = a.length; n < o; e = ++n) i = a[e],
                        this.pixelData[e] = i;
                        if (t) return this.context.putImageData(this.imageData, 0, 0)
                    },
                    r.prototype.reset = function() {
                        var t, e, r, i, n, o, a, s, h;
                        for (t = document.createElement("canvas"), _.copyAttributes(this.canvas, t), t.width = this.originalWidth, t.height = this.originalHeight, e = t.getContext("2d"), i = e.getImageData(0, 0, t.width, t.height), o = i.data, h = this.initializedPixelData, r = a = 0, s = h.length; a < s; r = ++a) n = h[r],
                        o[r] = n;
                        return e.putImageData(i, 0, 0),
                        this.cropCoordinates = {
                            x: 0,
                            y: 0
                        },
                        this.resized = !1,
                        this.replaceCanvas(t)
                    },
                    r.prototype.originalVisiblePixels = function() {
                        var t, e, i, n, o, a, s, h, l, c, u, g, d, f, p, x, m, v, b, y, w;
                        if (!r.allowRevert) throw "Revert disabled";
                        if (c = [], g = this.cropCoordinates.x, n = g + this.width, d = this.cropCoordinates.y, o = d + this.height, this.resized) {
                            for (t = document.createElement("canvas"), t.width = this.originalWidth, t.height = this.originalHeight, i = t.getContext("2d"), s = i.getImageData(0, 0, t.width, t.height), l = s.data, v = this.originalPixelData, a = p = 0, m = v.length; p < m; a = ++p) h = v[a],
                            l[a] = h;
                            i.putImageData(s, 0, 0),
                            u = document.createElement("canvas"),
                            u.width = this.width,
                            u.height = this.height,
                            i = u.getContext("2d"),
                            i.drawImage(t, 0, 0, this.originalWidth, this.originalHeight, 0, 0, this.width, this.height),
                            l = i.getImageData(0, 0, this.width, this.height).data,
                            f = this.width
                        } else l = this.originalPixelData,
                        f = this.originalWidth;
                        for (a = x = 0, b = l.length; x < b; a = x += 4) e = D.locationToCoordinates(a, f),
                        g <= (y = e.x) && y < n && d <= (w = e.y) && w < o && c.push(l[a], l[a + 1], l[a + 2], l[a + 3]);
                        return c
                    },
                    r.prototype.process = function(t, e) {
                        return this.renderer.add({
                            type: x.Type.Single,
                            name: t,
                            processFn: e
                        }),
                        this
                    },
                    r.prototype.processKernel = function(t, e, r, i) {
                        var n, o, a;
                        if (null == r && (r = null), null == i && (i = 0), null == r) for (r = 0, n = o = 0, a = e.length; 0 <= a ? o < a: o > a; n = 0 <= a ? ++o: --o) r += e[n];
                        return this.renderer.add({
                            type: x.Type.Kernel,
                            name: t,
                            adjust: e,
                            divisor: r,
                            bias: i
                        }),
                        this
                    },
                    r.prototype.processPlugin = function(t, e) {
                        return this.renderer.add({
                            type: x.Type.Plugin,
                            plugin: t,
                            args: e
                        }),
                        this
                    },
                    r.prototype.newLayer = function(t) {
                        var e;
                        return e = new b(this),
                        this.canvasQueue.push(e),
                        this.renderer.add({
                            type: x.Type.LayerDequeue
                        }),
                        t.call(e),
                        this.renderer.add({
                            type: x.Type.LayerFinished
                        }),
                        this
                    },
                    r.prototype.executeLayer = function(t) {
                        return this.pushContext(t)
                    },
                    r.prototype.pushContext = function(t) {
                        return this.layerStack.push(this.currentLayer),
                        this.pixelStack.push(this.pixelData),
                        this.currentLayer = t,
                        this.pixelData = t.pixelData
                    },
                    r.prototype.popContext = function() {
                        return this.pixelData = this.pixelStack.pop(),
                        this.currentLayer = this.layerStack.pop()
                    },
                    r.prototype.applyCurrentLayer = function() {
                        return this.currentLayer.applyToParent()
                    },
                    r
                } (w),
                C.Caman = c,
                c.Analyze = function() {
                    function t(t) {
                        this.c = t
                    }
                    return t.prototype.calculateLevels = function() {
                        var t, e, r, i, n, o, a;
                        for (e = {
                            r: {},
                            g: {},
                            b: {}
                        },
                        t = i = 0; i <= 255; t = ++i) e.r[t] = 0,
                        e.g[t] = 0,
                        e.b[t] = 0;
                        for (t = n = 0, a = this.c.pixelData.length; n < a; t = n += 4) e.r[this.c.pixelData[t]]++,
                        e.g[this.c.pixelData[t + 1]]++,
                        e.b[this.c.pixelData[t + 2]]++;
                        for (r = this.c.pixelData.length / 4, t = o = 0; o <= 255; t = ++o) e.r[t] /= r,
                        e.g[t] /= r,
                        e.b[t] /= r;
                        return e
                    },
                    t
                } (),
                n = c.Analyze,
                c.DOMUpdated = function() {
                    var t, e, r, i, n, o;
                    if (e = document.querySelectorAll("img[data-caman]"), e.length > 0) {
                        for (o = [], i = 0, n = e.length; i < n; i++) t = e[i],
                        o.push(r = new u(t,
                        function() {
                            return this.parse(),
                            this.execute()
                        }));
                        return o
                    }
                },
                c.autoload && !
                function() {
                    return "complete" === document.readyState ? c.DOMUpdated() : document.addEventListener("DOMContentLoaded", c.DOMUpdated, !1)
                } (),
                u = function() {
                    function t(t, e) {
                        this.dataStr = t.getAttribute("data-caman"),
                        this.caman = c(t, e.bind(this))
                    }
                    var e;
                    return e = "(\\w+)\\((.*?)\\)",
                    t.prototype.parse = function() {
                        var t, r, i, n, o, a, s, h, l, c, u, g, d;
                        if (this.ele = this.caman.canvas, h = new RegExp(e, "g"), l = this.dataStr.match(h), l.length > 0) {
                            for (h = new RegExp(e), d = [], c = 0, u = l.length; c < u; c++) {
                                o = l[c],
                                g = o.match(h),
                                s = g[0],
                                i = g[1],
                                t = g[2],
                                a = new Function("return function() {        this." + i + "(" + t + ");      };");
                                try {
                                    n = a(),
                                    d.push(n.call(this.caman))
                                } catch(t) {
                                    r = t,
                                    d.push(y.debug(r))
                                }
                            }
                            return d
                        }
                    },
                    t.prototype.execute = function() {
                        var t;
                        return t = this.ele,
                        this.caman.render(function() {
                            return t.parentNode.replaceChild(this.toImage(), t)
                        })
                    },
                    t
                } (),
                c.Blender = function() {
                    function t() {}
                    return t.blenders = {},
                    t.register = function(t, e) {
                        return this.blenders[t] = e
                    },
                    t.execute = function(t, e, r) {
                        return this.blenders[t](e, r)
                    },
                    t
                } (),
                a = c.Blender,
                c.Calculate = function() {
                    function t() {}
                    return t.distance = function(t, e, r, i) {
                        return Math.sqrt(Math.pow(r - t, 2) + Math.pow(i - e, 2))
                    },
                    t.randomRange = function(t, e, r) {
                        var i;
                        return null == r && (r = !1),
                        i = t + Math.random() * (e - t),
                        r ? i.toFixed(r) : Math.round(i)
                    },
                    t.luminance = function(t) {
                        return.299 * t.r + .587 * t.g + .114 * t.b
                    },
                    t.bezier = function(t, e, r, i, n, o) {
                        var a, s, h, l, u, g, d, f, p, x, m, v, b;
                        if (null == n && (n = 0), null == o && (o = 255), t[0] instanceof Array ? (h = t, n = e, o = r) : h = [t, e, r, i], h.length < 2) throw "Invalid number of arguments to bezier";
                        for (a = {},
                        d = function(t, e, r) {
                            return t * (1 - r) + e * r
                        },
                        s = function(t, e, r) {
                            return Math.min(Math.max(t, e), r)
                        },
                        u = m = 0; m < 1e3; u = ++m) {
                            for (x = u / 1e3, p = h; p.length > 1;) {
                                for (f = [], g = v = 0, b = p.length - 2; 0 <= b ? v <= b: v >= b; g = 0 <= b ? ++v: --v) f.push([d(p[g][0], p[g + 1][0], x), d(p[g][1], p[g + 1][1], x)]);
                                p = f
                            }
                            a[Math.round(p[0][0])] = Math.round(s(p[0][1], n, o))
                        }
                        return l = h[h.length - 1][0],
                        a = c.Calculate.missingValues(a, l),
                        null == a[l] && (a[l] = a[l - 1]),
                        a
                    },
                    t.hermite = function(t, e, r) {
                        var i, n, o, a, s, h, l, u, g, d, f, p, x, m, v, b, y, w, D, R, T, C, E, _, S, F;
                        if (t.length < 2) throw "Invalid number of arguments to hermite";
                        for (T = {},
                        f = function(t, e, r) {
                            return t * (1 - r) + e * r
                        },
                        i = function(t, e, r, i) {
                            return [t[0] + e[0] + r[0] + i[0], t[1] + e[1] + r[1] + i[1]]
                        },
                        m = function(t, e) {
                            return [t[0] * e[0], t[1] * e[1]]
                        },
                        C = function(t, e) {
                            return [t[0] - e[0], t[1] - e[1]]
                        },
                        n = function(t, e, r) {
                            return Math.min(Math.max(t, e), r)
                        },
                        o = 0, g = _ = 0, F = t.length - 2; 0 <= F ? _ <= F: _ >= F; g = 0 <= F ? ++_: --_) for (b = t[g], y = t[g + 1], w = y[0] - b[0], D = 1 / w, g === t.length - 2 && (D = 1 / (w - 1)), v = g > 0 ? t[g - 1] : b, p = m(C(y, v), [.5, .5]), v = g < t.length - 2 ? t[g + 2] : y, x = m(C(v, b), [.5, .5]), d = S = 0; 0 <= w ? S <= w: S >= w; d = 0 <= w ? ++S: --S) E = d * D,
                        s = 2 * E * E * E - 3 * E * E + 1,
                        h = E * E * E - 2 * E * E + E,
                        l = -2 * E * E * E + 3 * E * E,
                        u = E * E * E - E * E,
                        R = i(m(b, [s, s]), m(p, [h, h]), m(y, [l, l]), m(x, [u, u])),
                        T[Math.round(R[0])] = Math.round(n(R[1], e, r)),
                        o += 1;
                        return a = t[t.length - 1][0],
                        T = c.Calculate.missingValues(T, a)
                    },
                    t.missingValues = function(t, e) {
                        var r, i, n, a, s, h, l;
                        if ((0, o.
                    default)(t).length < e + 1) {
                            for (a = {},
                            r = h = 0; 0 <= e ? h <= e: h >= e; r = 0 <= e ? ++h: --h) if (null != t[r]) a[r] = t[r];
                            else {
                                for (n = [r - 1, a[r - 1]], i = l = r; r <= e ? l <= e: l >= e; i = r <= e ? ++l: --l) if (null != t[i]) {
                                    s = [i, t[i]];
                                    break
                                }
                                a[r] = n[1] + (s[1] - n[1]) / (s[0] - n[0]) * (r - n[0])
                            }
                            return a
                        }
                        return t
                    },
                    t
                } (),
                h = c.Calculate,
                c.Convert = function() {
                    function t() {}
                    return t.hexToRGB = function(t) {
                        var e, r, i;
                        return "#" === t.charAt(0) && (t = t.substr(1)),
                        i = parseInt(t.substr(0, 2), 16),
                        r = parseInt(t.substr(2, 2), 16),
                        e = parseInt(t.substr(4, 2), 16),
                        {
                            r: i,
                            g: r,
                            b: e
                        }
                    },
                    t.rgbToHSL = function(t, e, r) {
                        var i, n, o, a, h, l;
                        return "object" === ("undefined" == typeof t ? "undefined": (0, s.
                    default)(t)) && (e = t.g, r = t.b, t = t.r),
                        t /= 255,
                        e /= 255,
                        r /= 255,
                        a = Math.max(t, e, r),
                        h = Math.min(t, e, r),
                        o = (a + h) / 2,
                        a === h ? n = l = 0 : (i = a - h, l = o > .5 ? i / (2 - a - h) : i / (a + h), n = function() {
                            switch (a) {
                            case t:
                                return (e - r) / i + (e < r ? 6 : 0);
                            case e:
                                return (r - t) / i + 2;
                            case r:
                                return (t - e) / i + 4
                            }
                        } (), n /= 6),
                        {
                            h: n,
                            s: l,
                            l: o
                        }
                    },
                    t.hslToRGB = function(t, e, r) {
                        var i, n, o, a, h;
                        return "object" === ("undefined" == typeof t ? "undefined": (0, s.
                    default)(t)) && (e = t.s, r = t.l, t = t.h),
                        0 === e ? h = n = i = r: (a = r < .5 ? r * (1 + e) : r + e - r * e, o = 2 * r - a, h = this.hueToRGB(o, a, t + 1 / 3), n = this.hueToRGB(o, a, t), i = this.hueToRGB(o, a, t - 1 / 3)),
                        {
                            r: 255 * h,
                            g: 255 * n,
                            b: 255 * i
                        }
                    },
                    t.hueToRGB = function(t, e, r) {
                        return r < 0 && (r += 1),
                        r > 1 && (r -= 1),
                        r < 1 / 6 ? t + 6 * (e - t) * r: r < .5 ? e: r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t
                    },
                    t.rgbToHSV = function(t, e, r) {
                        var i, n, o, a, s, h;
                        return t /= 255,
                        e /= 255,
                        r /= 255,
                        o = Math.max(t, e, r),
                        a = Math.min(t, e, r),
                        h = o,
                        i = o - a,
                        s = 0 === o ? 0 : i / o,
                        o === a ? n = 0 : (n = function() {
                            switch (o) {
                            case t:
                                return (e - r) / i + (e < r ? 6 : 0);
                            case e:
                                return (r - t) / i + 2;
                            case r:
                                return (t - e) / i + 4
                            }
                        } (), n /= 6),
                        {
                            h: n,
                            s: s,
                            v: h
                        }
                    },
                    t.hsvToRGB = function(t, e, r) {
                        var i, n, o, a, s, h, l, c;
                        switch (a = Math.floor(6 * t), n = 6 * t - a, s = r * (1 - e), h = r * (1 - n * e), c = r * (1 - (1 - n) * e), a % 6) {
                        case 0:
                            l = r,
                            o = c,
                            i = s;
                            break;
                        case 1:
                            l = h,
                            o = r,
                            i = s;
                            break;
                        case 2:
                            l = s,
                            o = r,
                            i = c;
                            break;
                        case 3:
                            l = s,
                            o = h,
                            i = r;
                            break;
                        case 4:
                            l = c,
                            o = s,
                            i = r;
                            break;
                        case 5:
                            l = r,
                            o = s,
                            i = h
                        }
                        return {
                            r: Math.floor(255 * l),
                            g: Math.floor(255 * o),
                            b: Math.floor(255 * i)
                        }
                    },
                    t.rgbToXYZ = function(t, e, r) {
                        var i, n, o;
                        return t /= 255,
                        e /= 255,
                        r /= 255,
                        t > .04045 ? t = Math.pow((t + .055) / 1.055, 2.4) : t /= 12.92,
                        e > .04045 ? e = Math.pow((e + .055) / 1.055, 2.4) : e /= 12.92,
                        r > .04045 ? r = Math.pow((r + .055) / 1.055, 2.4) : r /= 12.92,
                        i = .4124 * t + .3576 * e + .1805 * r,
                        n = .2126 * t + .7152 * e + .0722 * r,
                        o = .0193 * t + .1192 * e + .9505 * r,
                        {
                            x: 100 * i,
                            y: 100 * n,
                            z: 100 * o
                        }
                    },
                    t.xyzToRGB = function(t, e, r) {
                        var i, n, o;
                        return t /= 100,
                        e /= 100,
                        r /= 100,
                        o = 3.2406 * t + -1.5372 * e + -.4986 * r,
                        n = -.9689 * t + 1.8758 * e + .0415 * r,
                        i = .0557 * t + -.204 * e + 1.057 * r,
                        o > .0031308 ? o = 1.055 * Math.pow(o, .4166666667) - .055 : o *= 12.92,
                        n > .0031308 ? n = 1.055 * Math.pow(n, .4166666667) - .055 : n *= 12.92,
                        i > .0031308 ? i = 1.055 * Math.pow(i, .4166666667) - .055 : i *= 12.92,
                        {
                            r: 255 * o,
                            g: 255 * n,
                            b: 255 * i
                        }
                    },
                    t.xyzToLab = function(t, e, r) {
                        var i, n, o, a, h, l;
                        return "object" === ("undefined" == typeof t ? "undefined": (0, s.
                    default)(t)) && (e = t.y, r = t.z, t = t.x),
                        a = 95.047,
                        h = 100,
                        l = 108.883,
                        t /= a,
                        e /= h,
                        r /= l,
                        t = t > .008856451679 ? Math.pow(t, .3333333333) : 7.787037037 * t + .1379310345,
                        e = e > .008856451679 ? Math.pow(e, .3333333333) : 7.787037037 * e + .1379310345,
                        r = r > .008856451679 ? Math.pow(r, .3333333333) : 7.787037037 * r + .1379310345,
                        o = 116 * e - 16,
                        i = 500 * (t - e),
                        n = 200 * (e - r),
                        {
                            l: o,
                            a: i,
                            b: n
                        }
                    },
                    t.labToXYZ = function(t, e, r) {
                        var i, n, o;
                        return "object" === ("undefined" == typeof t ? "undefined": (0, s.
                    default)(t)) && (e = t.a, r = t.b, t = t.l),
                        n = (t + 16) / 116,
                        i = n + e / 500,
                        o = n - r / 200,
                        i > .2068965517 ? i *= i * i: i = .1284185493 * (i - .1379310345),
                        n > .2068965517 ? n *= n * n: n = .1284185493 * (n - .1379310345),
                        o > .2068965517 ? o *= o * o: o = .1284185493 * (o - .1379310345),
                        {
                            x: 95.047 * i,
                            y: 100 * n,
                            z: 108.883 * o
                        }
                    },
                    t.rgbToLab = function(t, e, r) {
                        var i;
                        return "object" === ("undefined" == typeof t ? "undefined": (0, s.
                    default)(t)) && (e = t.g, r = t.b, t = t.r),
                        i = this.rgbToXYZ(t, e, r),
                        this.xyzToLab(i)
                    },
                    t.labToRGB = function(t, e, r) {},
                    t
                } (),
                d = c.Convert,
                c.Event = function() {
                    function t() {}
                    return t.events = {},
                    t.types = ["processStart", "processComplete", "renderStart", "renderFinished", "blockStarted", "blockFinished"],
                    t.trigger = function(t, e, r) {
                        var i, n, o, a, s;
                        if (null == r && (r = null), this.events[e] && this.events[e].length) {
                            for (a = this.events[e], s = [], n = 0, o = a.length; n < o; n++) i = a[n],
                            null === i.target || t.id === i.target.id ? s.push(i.fn.call(t, r)) : s.push(void 0);
                            return s
                        }
                    },
                    t.listen = function(t, e, r) {
                        var i, n;
                        return "string" == typeof t && (n = t, i = e, t = null, e = n, r = i),
                        !(B.call(this.types, e) < 0) && (this.events[e] || (this.events[e] = []), this.events[e].push({
                            target: t,
                            fn: r
                        }), !0)
                    },
                    t
                } (),
                f = c.Event,
                c.Filter = function() {
                    function t() {}
                    return t.Type = {
                        Single: 1,
                        Kernel: 2,
                        LayerDequeue: 3,
                        LayerFinished: 4,
                        LoadOverlay: 5,
                        Plugin: 6
                    },
                    t.register = function(t, e) {
                        return c.prototype[t] = e
                    },
                    t
                } (),
                x = c.Filter,
                c.IO = function() {
                    function t() {}
                    return t.domainRegex = /(?:(?:http|https):\/\/)((?:\w+)\.(?:(?:\w|\.)+))/,
                    t.isRemote = function(t) {
                        return null != t && (!this.corsEnabled(t) && this.isURLRemote(t.src))
                    },
                    t.corsEnabled = function(t) {
                        var e;
                        return null != t.crossOrigin && ("anonymous" === (e = t.crossOrigin.toLowerCase()) || "use-credentials" === e)
                    },
                    t.isURLRemote = function(t) {
                        var e;
                        return e = t.match(this.domainRegex),
                        !!e && e[1] !== document.domain
                    },
                    t.remoteCheck = function(t) {
                        if (this.isURLRemote(t)) {
                            if (c.remoteProxy.length) return c.isURLRemote(c.remoteProxy) ? void y.info("Cannot use a remote proxy for loading images.") : this.proxyUrl(t);
                            y.info("Attempting to load a remote image without a configured proxy. URL: " + t)
                        }
                    },
                    t.proxyUrl = function(t) {
                        return "" + c.remoteProxy + "?" + c.proxyParam + "=" + encodeURIComponent(t)
                    },
                    t.useProxy = function(t) {
                        var e;
                        return e = {
                            ruby: "rb",
                            python: "py",
                            perl: "pl",
                            javascript: "js"
                        },
                        t = t.toLowerCase(),
                        null != e[t] && (t = e[t]),
                        "proxies/caman_proxy." + t
                    },
                    t
                } (),
                c.prototype.save = function() {
                    return "undefined" != typeof e && null !== e ? this.nodeSave.apply(this, arguments) : this.browserSave.apply(this, arguments)
                },
                c.prototype.browserSave = function(t) {
                    var e;
                    return null == t && (t = "png"),
                    t = t.toLowerCase(),
                    e = this.toBase64(t).replace("image/" + t, "image/octet-stream"),
                    document.location.href = e
                },
                c.prototype.nodeSave = function(t, e, r) {
                    var i, n;
                    null == e && (e = !0),
                    null == r && (r = null);
                    try {
                        if (n = S.statSync(t), n.isFile() && !e) return ! 1
                    } catch(e) {
                        i = e,
                        y.debug("Creating output file " + t)
                    }
                    return S.writeFile(t, this.canvas.toBuffer(),
                    function(e) {
                        if (y.debug("Finished writing to " + t), r) return r.call(this, e)
                    })
                },
                c.prototype.toImage = function(t) {
                    var e;
                    return e = new v,
                    e.src = this.toBase64(t),
                    e.width = this.dimensions.width,
                    e.height = this.dimensions.height,
                    window.devicePixelRatio && (e.width /= window.devicePixelRatio, e.height /= window.devicePixelRatio),
                    e
                },
                c.prototype.toBase64 = function(t) {
                    return null == t && (t = "png"),
                    t = t.toLowerCase(),
                    this.canvas.toDataURL("image/" + t)
                },
                m = c.IO,
                c.Layer = function() {
                    function t(t) {
                        this.c = t,
                        this.filter = this.c,
                        this.options = {
                            blendingMode: "normal",
                            opacity: 1
                        },
                        this.layerID = _.uniqid.get(),
                        this.canvas = "undefined" != typeof e && null !== e ? new g: document.createElement("canvas"),
                        this.canvas.width = this.c.dimensions.width,
                        this.canvas.height = this.c.dimensions.height,
                        this.context = this.canvas.getContext("2d"),
                        this.context.createImageData(this.canvas.width, this.canvas.height),
                        this.imageData = this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),
                        this.pixelData = this.imageData.data
                    }
                    return t.prototype.newLayer = function(t) {
                        return this.c.newLayer.call(this.c, t)
                    },
                    t.prototype.setBlendingMode = function(t) {
                        return this.options.blendingMode = t,
                        this
                    },
                    t.prototype.opacity = function(t) {
                        return this.options.opacity = t / 100,
                        this
                    },
                    t.prototype.copyParent = function() {
                        var t, e, r, i;
                        for (e = this.c.pixelData, t = r = 0, i = this.c.pixelData.length; r < i; t = r += 4) this.pixelData[t] = e[t],
                        this.pixelData[t + 1] = e[t + 1],
                        this.pixelData[t + 2] = e[t + 2],
                        this.pixelData[t + 3] = e[t + 3];
                        return this
                    },
                    t.prototype.fillColor = function() {
                        return this.c.fillColor.apply(this.c, arguments)
                    },
                    t.prototype.overlayImage = function(t) {
                        return "object" === ("undefined" == typeof t ? "undefined": (0, s.
                    default)(t)) ? t = t.src: "string" == typeof t && "#" === t[0] && (t = i(t).src),
                        t ? (this.c.renderer.renderQueue.push({
                            type: x.Type.LoadOverlay,
                            src: t,
                            layer: this
                        }), this) : this
                    },
                    t.prototype.applyToParent = function() {
                        var t, e, r, i, n, o, s, h, l;
                        for (r = this.c.pixelStack[this.c.pixelStack.length - 1], e = this.c.pixelData, l = [], t = s = 0, h = e.length; s < h; t = s += 4) o = {
                            r: r[t],
                            g: r[t + 1],
                            b: r[t + 2],
                            a: r[t + 3]
                        },
                        n = {
                            r: e[t],
                            g: e[t + 1],
                            b: e[t + 2],
                            a: e[t + 3]
                        },
                        i = a.execute(this.options.blendingMode, n, o),
                        i.r = _.clampRGB(i.r),
                        i.g = _.clampRGB(i.g),
                        i.b = _.clampRGB(i.b),
                        null == i.a && (i.a = n.a),
                        r[t] = o.r - (o.r - i.r) * (this.options.opacity * (i.a / 255)),
                        r[t + 1] = o.g - (o.g - i.g) * (this.options.opacity * (i.a / 255)),
                        l.push(r[t + 2] = o.b - (o.b - i.b) * (this.options.opacity * (i.a / 255)));
                        return l
                    },
                    t
                } (),
                b = c.Layer,
                c.Logger = function() {
                    function t() {
                        var t, e, r, i;
                        for (i = ["log", "info", "warn", "error"], e = 0, r = i.length; e < r; e++) t = i[e],
                        this[t] = function(t) {
                            return function() {
                                var t, e;
                                if (t = 1 <= arguments.length ? M.call(arguments, 0) : [], c.DEBUG) try {
                                    return
                                } catch(t) {
                                    return void(e = t)
                                }
                            }
                        } (t);
                        this.debug = this.log
                    }
                    return t
                } (),
                y = new c.Logger,
                c.Pixel = function() {
                    function t(t, e, r, i, n) {
                        this.r = null != t ? t: 0,
                        this.g = null != e ? e: 0,
                        this.b = null != r ? r: 0,
                        this.a = null != i ? i: 255,
                        this.c = null != n ? n: null,
                        this.loc = 0
                    }
                    return t.coordinatesToLocation = function(t, e, r) {
                        return 4 * (e * r + t)
                    },
                    t.locationToCoordinates = function(t, e) {
                        var r, i;
                        return i = Math.floor(t / (4 * e)),
                        r = t % (4 * e) / 4,
                        {
                            x: r,
                            y: i
                        }
                    },
                    t.prototype.setContext = function(t) {
                        return this.c = t
                    },
                    t.prototype.locationXY = function() {
                        var t, e;
                        if (null == this.c) throw "Requires a CamanJS context";
                        return e = this.c.dimensions.height - Math.floor(this.loc / (4 * this.c.dimensions.width)),
                        t = this.loc % (4 * this.c.dimensions.width) / 4,
                        {
                            x: t,
                            y: e
                        }
                    },
                    t.prototype.pixelAtLocation = function(e) {
                        if (null == this.c) throw "Requires a CamanJS context";
                        return new t(this.c.pixelData[e], this.c.pixelData[e + 1], this.c.pixelData[e + 2], this.c.pixelData[e + 3], this.c)
                    },
                    t.prototype.getPixelRelative = function(e, r) {
                        var i;
                        if (null == this.c) throw "Requires a CamanJS context";
                        return i = this.loc + 4 * this.c.dimensions.width * (r * -1) + 4 * e,
                        i > this.c.pixelData.length || i < 0 ? new t(0, 0, 0, 255, this.c) : this.pixelAtLocation(i)
                    },
                    t.prototype.putPixelRelative = function(t, e, r) {
                        var i;
                        if (null == this.c) throw "Requires a CamanJS context";
                        if (i = this.loc + 4 * this.c.dimensions.width * (e * -1) + 4 * t, !(newLoc > this.c.pixelData.length || newLoc < 0)) return this.c.pixelData[newLoc] = r.r,
                        this.c.pixelData[newLoc + 1] = r.g,
                        this.c.pixelData[newLoc + 2] = r.b,
                        this.c.pixelData[newLoc + 3] = r.a,
                        !0
                    },
                    t.prototype.getPixel = function(t, e) {
                        var r;
                        if (null == this.c) throw "Requires a CamanJS context";
                        return r = this.coordinatesToLocation(t, e, this.width),
                        this.pixelAtLocation(r)
                    },
                    t.prototype.putPixel = function(t, e, r) {
                        var i;
                        if (null == this.c) throw "Requires a CamanJS context";
                        return i = this.coordinatesToLocation(t, e, this.width),
                        this.c.pixelData[i] = r.r,
                        this.c.pixelData[i + 1] = r.g,
                        this.c.pixelData[i + 2] = r.b,
                        this.c.pixelData[i + 3] = r.a
                    },
                    t.prototype.toString = function() {
                        return this.toKey()
                    },
                    t.prototype.toHex = function(t) {
                        var e;
                        return null == t && (t = !1),
                        e = "#" + this.r.toString(16) + this.g.toString(16) + this.b.toString(16),
                        t ? e + this.a.toString(16) : e
                    },
                    t
                } (),
                D = c.Pixel,
                c.Plugin = function() {
                    function t() {}
                    return t.plugins = {},
                    t.register = function(t, e) {
                        return this.plugins[t] = e
                    },
                    t.execute = function(t, e, r) {
                        return this.plugins[e].apply(t, r)
                    },
                    t
                } (),
                R = c.Plugin,
                c.Renderer = function() {
                    function t(t) {
                        this.c = t,
                        this.processNext = L(this.processNext, this),
                        this.renderQueue = [],
                        this.modPixelData = null
                    }
                    return t.Blocks = c.NodeJS ? r(650).cpus().length: 4,
                    t.prototype.add = function(t) {
                        if (null != t) return this.renderQueue.push(t)
                    },
                    t.prototype.processNext = function() {
                        var t;
                        if (0 === this.renderQueue.length) return f.trigger(this, "renderFinished"),
                        null != this.finishedFn && this.finishedFn.call(this.c),
                        this;
                        switch (this.currentJob = this.renderQueue.shift(), this.currentJob.type) {
                        case x.Type.LayerDequeue:
                            return t = this.c.canvasQueue.shift(),
                            this.c.executeLayer(t),
                            this.processNext();
                        case x.Type.LayerFinished:
                            return this.c.applyCurrentLayer(),
                            this.c.popContext(),
                            this.processNext();
                        case x.Type.LoadOverlay:
                            return this.loadOverlay(this.currentJob.layer, this.currentJob.src);
                        case x.Type.Plugin:
                            return this.executePlugin();
                        default:
                            return this.executeFilter()
                        }
                    },
                    t.prototype.execute = function(t) {
                        return this.finishedFn = t,
                        this.modPixelData = _.dataArray(this.c.pixelData.length),
                        this.processNext()
                    },
                    t.prototype.eachBlock = function(e) {
                        var r, i, n, o, a, s, h, l, u, g, d, f, x = this;
                        for (this.blocksDone = 0, l = this.c.pixelData.length, i = Math.floor(l / 4 / t.Blocks), r = 4 * i, h = r + l / 4 % t.Blocks * 4, f = [], s = g = 0, d = t.Blocks; 0 <= d ? g < d: g > d; s = 0 <= d ? ++g: --g) u = s * r,
                        o = u + (s === t.Blocks - 1 ? h: r),
                        c.NodeJS ? (a = p(function() {
                            return e.call(x, s, u, o)
                        }), n = a.run(), f.push(this.blockFinished(n))) : f.push(setTimeout(function(t, r, i) {
                            return function() {
                                return e.call(x, t, r, i)
                            }
                        } (s, u, o), 0));
                        return f
                    },
                    t.prototype.executeFilter = function() {
                        return f.trigger(this.c, "processStart", this.currentJob),
                        this.currentJob.type === x.Type.Single ? this.eachBlock(this.renderBlock) : this.eachBlock(this.renderKernel)
                    },
                    t.prototype.executePlugin = function() {
                        return y.debug("Executing plugin " + this.currentJob.plugin),
                        R.execute(this.c, this.currentJob.plugin, this.currentJob.args),
                        y.debug("Plugin " + this.currentJob.plugin + " finished!"),
                        this.processNext()
                    },
                    t.prototype.renderBlock = function(e, r, i) {
                        var n, o, a;
                        for (y.debug("Block #" + e + " - Filter: " + this.currentJob.name + ", Start: " + r + ", End: " + i), f.trigger(this.c, "blockStarted", {
                            blockNum: e,
                            totalBlocks: t.Blocks,
                            startPixel: r,
                            endPixel: i
                        }), o = new D, o.setContext(this.c), n = a = r; a < i; n = a += 4) o.loc = n,
                        o.r = this.c.pixelData[n],
                        o.g = this.c.pixelData[n + 1],
                        o.b = this.c.pixelData[n + 2],
                        o.a = this.c.pixelData[n + 3],
                        this.currentJob.processFn(o),
                        this.c.pixelData[n] = _.clampRGB(o.r),
                        this.c.pixelData[n + 1] = _.clampRGB(o.g),
                        this.c.pixelData[n + 2] = _.clampRGB(o.b),
                        this.c.pixelData[n + 3] = _.clampRGB(o.a);
                        return c.NodeJS ? p.yield(e) : this.blockFinished(e)
                    },
                    t.prototype.renderKernel = function(t, e, r) {
                        var i, n, o, a, s, h, l, u, g, d, f, x, m, v, b, w, R, T;
                        for (x = this.currentJob.name, o = this.currentJob.bias, h = this.currentJob.divisor, f = this.c.pixelData.length, i = this.currentJob.adjust, n = Math.sqrt(i.length), d = [], y.debug("Rendering kernel - Filter: " + this.currentJob.name), e = Math.max(e, 4 * this.c.dimensions.width * ((n - 1) / 2)), r = Math.min(r, f - 4 * this.c.dimensions.width * ((n - 1) / 2)), a = (n - 1) / 2, v = new D, v.setContext(this.c), l = w = e; w < r; l = w += 4) {
                            for (v.loc = l, s = 0, u = R = -a; - a <= a ? R <= a: R >= a; u = -a <= a ? ++R: --R) for (g = T = a; a <= -a ? T <= -a: T >= -a; g = a <= -a ? ++T: --T) m = v.getPixelRelative(u, g),
                            d[3 * s] = m.r,
                            d[3 * s + 1] = m.g,
                            d[3 * s + 2] = m.b,
                            s++;
                            b = this.processKernel(i, d, h, o),
                            this.modPixelData[l] = _.clampRGB(b.r),
                            this.modPixelData[l + 1] = _.clampRGB(b.g),
                            this.modPixelData[l + 2] = _.clampRGB(b.b),
                            this.modPixelData[l + 3] = this.c.pixelData[l + 3]
                        }
                        return c.NodeJS ? p.yield(t) : this.blockFinished(t)
                    },
                    t.prototype.blockFinished = function(e) {
                        var r, i, n;
                        if (e >= 0 && y.debug("Block #" + e + " finished! Filter: " + this.currentJob.name), this.blocksDone++, f.trigger(this.c, "blockFinished", {
                            blockNum: e,
                            blocksFinished: this.blocksDone,
                            totalBlocks: t.Blocks
                        }), this.blocksDone === t.Blocks) {
                            if (this.currentJob.type === x.Type.Kernel) for (r = i = 0, n = this.c.pixelData.length; 0 <= n ? i < n: i > n; r = 0 <= n ? ++i: --i) this.c.pixelData[r] = this.modPixelData[r];
                            return e >= 0 && y.debug("Filter " + this.currentJob.name + " finished!"),
                            f.trigger(this.c, "processComplete", this.currentJob),
                            this.processNext()
                        }
                    },
                    t.prototype.processKernel = function(t, e, r, i) {
                        var n, o, a, s;
                        for (o = {
                            r: 0,
                            g: 0,
                            b: 0
                        },
                        n = a = 0, s = t.length; 0 <= s ? a < s: a > s; n = 0 <= s ? ++a: --a) o.r += t[n] * e[3 * n],
                        o.g += t[n] * e[3 * n + 1],
                        o.b += t[n] * e[3 * n + 2];
                        return o.r = o.r / r + i,
                        o.g = o.g / r + i,
                        o.b = o.b / r + i,
                        o
                    },
                    t.prototype.loadOverlay = function(t, e) {
                        var r, i, n = this;
                        return r = new v,
                        r.onload = function() {
                            return t.context.drawImage(r, 0, 0, n.c.dimensions.width, n.c.dimensions.height),
                            t.imageData = t.context.getImageData(0, 0, n.c.dimensions.width, n.c.dimensions.height),
                            t.pixelData = t.imageData.data,
                            n.c.pixelData = t.pixelData,
                            n.processNext()
                        },
                        i = m.remoteCheck(e),
                        r.src = null != i ? i: e
                    },
                    t
                } (),
                T = c.Renderer,
                c.Store = function() {
                    function t() {}
                    return t.items = {},
                    t.has = function(t) {
                        return null != this.items[t]
                    },
                    t.get = function(t) {
                        return this.items[t]
                    },
                    t.put = function(t, e) {
                        return this.items[t] = e
                    },
                    t.execute = function(t, e) {
                        var r = this;
                        return setTimeout(function() {
                            return e.call(r.get(t), r.get(t))
                        },
                        0),
                        this.get(t)
                    },
                    t.flush = function(t) {
                        return null == t && (t = !1),
                        t ? delete this.items[t] : this.items = {}
                    },
                    t
                } (),
                E = c.Store,
                a.register("normal",
                function(t, e) {
                    return {
                        r: t.r,
                        g: t.g,
                        b: t.b
                    }
                }),
                a.register("multiply",
                function(t, e) {
                    return {
                        r: t.r * e.r / 255,
                        g: t.g * e.g / 255,
                        b: t.b * e.b / 255
                    }
                }),
                a.register("screen",
                function(t, e) {
                    return {
                        r: 255 - (255 - t.r) * (255 - e.r) / 255,
                        g: 255 - (255 - t.g) * (255 - e.g) / 255,
                        b: 255 - (255 - t.b) * (255 - e.b) / 255
                    }
                }),
                a.register("overlay",
                function(t, e) {
                    var r;
                    return r = {},
                    r.r = e.r > 128 ? 255 - 2 * (255 - t.r) * (255 - e.r) / 255 : e.r * t.r * 2 / 255,
                    r.g = e.g > 128 ? 255 - 2 * (255 - t.g) * (255 - e.g) / 255 : e.g * t.g * 2 / 255,
                    r.b = e.b > 128 ? 255 - 2 * (255 - t.b) * (255 - e.b) / 255 : e.b * t.b * 2 / 255,
                    r
                }),
                a.register("difference",
                function(t, e) {
                    return {
                        r: t.r - e.r,
                        g: t.g - e.g,
                        b: t.b - e.b
                    }
                }),
                a.register("addition",
                function(t, e) {
                    return {
                        r: e.r + t.r,
                        g: e.g + t.g,
                        b: e.b + t.b
                    }
                }),
                a.register("exclusion",
                function(t, e) {
                    return {
                        r: 128 - 2 * (e.r - 128) * (t.r - 128) / 255,
                        g: 128 - 2 * (e.g - 128) * (t.g - 128) / 255,
                        b: 128 - 2 * (e.b - 128) * (t.b - 128) / 255
                    }
                }),
                a.register("softLight",
                function(t, e) {
                    var r;
                    return r = {},
                    r.r = e.r > 128 ? 255 - (255 - e.r) * (255 - (t.r - 128)) / 255 : e.r * (t.r + 128) / 255,
                    r.g = e.g > 128 ? 255 - (255 - e.g) * (255 - (t.g - 128)) / 255 : e.g * (t.g + 128) / 255,
                    r.b = e.b > 128 ? 255 - (255 - e.b) * (255 - (t.b - 128)) / 255 : e.b * (t.b + 128) / 255,
                    r
                }),
                a.register("lighten",
                function(t, e) {
                    return {
                        r: e.r > t.r ? e.r: t.r,
                        g: e.g > t.g ? e.g: t.g,
                        b: e.b > t.b ? e.b: t.b
                    }
                }),
                a.register("darken",
                function(t, e) {
                    return {
                        r: e.r > t.r ? t.r: e.r,
                        g: e.g > t.g ? t.g: e.g,
                        b: e.b > t.b ? t.b: e.b
                    }
                }),
                x.register("fillColor",
                function() {
                    var t;
                    return t = 1 === arguments.length ? d.hexToRGB(arguments[0]) : {
                        r: arguments[0],
                        g: arguments[1],
                        b: arguments[2]
                    },
                    this.process("fillColor",
                    function(e) {
                        return e.r = t.r,
                        e.g = t.g,
                        e.b = t.b,
                        e.a = 255,
                        e
                    })
                }),
                x.register("brightness",
                function(t) {
                    return t = Math.floor(255 * (t / 100)),
                    this.process("brightness",
                    function(e) {
                        return e.r += t,
                        e.g += t,
                        e.b += t,
                        e
                    })
                }),
                x.register("saturation",
                function(t) {
                    return t *= -.01,
                    this.process("saturation",
                    function(e) {
                        var r;
                        return r = Math.max(e.r, e.g, e.b),
                        e.r !== r && (e.r += (r - e.r) * t),
                        e.g !== r && (e.g += (r - e.g) * t),
                        e.b !== r && (e.b += (r - e.b) * t),
                        e
                    })
                }),
                x.register("mjSaturation",
                function(t) {
                    return t *= .01,
                    this.process("mjSaturation",
                    function(e) {
                        var r = (e.r + e.g + e.b) / 3;
                        return t >= 0 ? (e.r += (r - e.r) * (1 - 1 / (1.001 - t)), e.g += (r - e.g) * (1 - 1 / (1.001 - t)), e.b += (r - e.b) * (1 - 1 / (1.001 - t))) : (e.r += (r - e.r) * -t, e.g += (r - e.g) * -t, e.b += (r - e.b) * -t),
                        e
                    })
                }),
                x.register("vibrance",
                function(t) {
                    return t *= -1,
                    this.process("vibrance",
                    function(e) {
                        var r, i, n;
                        return n = Math.max(e.r, e.g, e.b),
                        i = (e.r + e.g + e.b) / 3,
                        r = 2 * Math.abs(n - i) / 255 * t / 100,
                        e.r !== n && (e.r += (n - e.r) * r),
                        e.g !== n && (e.g += (n - e.g) * r),
                        e.b !== n && (e.b += (n - e.b) * r),
                        e
                    })
                }),
                x.register("greyscale",
                function(t) {
                    return this.process("greyscale",
                    function(t) {
                        var e;
                        return e = h.luminance(t),
                        t.r = e,
                        t.g = e,
                        t.b = e,
                        t
                    })
                }),
                x.register("contrast",
                function(t) {
                    return t = Math.pow((t + 100) / 100, 2),
                    this.process("contrast",
                    function(e) {
                        return e.r /= 255,
                        e.r -= .5,
                        e.r *= t,
                        e.r += .5,
                        e.r *= 255,
                        e.g /= 255,
                        e.g -= .5,
                        e.g *= t,
                        e.g += .5,
                        e.g *= 255,
                        e.b /= 255,
                        e.b -= .5,
                        e.b *= t,
                        e.b += .5,
                        e.b *= 255,
                        e
                    })
                }),
                x.register("mjContrast",
                function(t) {
                    return t /= 100,
                    this.process("mjContrast",
                    function(e) {
                        return t >= 0 ? (e.r = Math.round(255 * ((e.r / 255 - .5) / (1 - t) + .5)), e.g = Math.round(255 * ((e.g / 255 - .5) / (1 - t) + .5)), e.b = Math.round(255 * ((e.b / 255 - .5) / (1 - t) + .5))) : (e.r = Math.round(255 * ((e.r / 255 - .5) * (1 + t) + .5)), e.g = Math.round(255 * ((e.g / 255 - .5) * (1 + t) + .5)), e.b = Math.round(255 * ((e.b / 255 - .5) * (1 + t) + .5))),
                        e
                    })
                }),
                x.register("hue",
                function(t) {
                    return this.process("hue",
                    function(e) {
                        var r, i, n, o, a, s;
                        return o = d.rgbToHSV(e.r, e.g, e.b),
                        n = 100 * o.h,
                        n += Math.abs(t),
                        n %= 100,
                        n /= 100,
                        o.h = n,
                        s = d.hsvToRGB(o.h, o.s, o.v),
                        a = s.r,
                        i = s.g,
                        r = s.b,
                        e.r = a,
                        e.g = i,
                        e.b = r,
                        e
                    })
                }),
                x.register("colorize",
                function() {
                    var t, e;
                    return 2 === arguments.length ? (e = d.hexToRGB(arguments[0]), t = arguments[1]) : 4 === arguments.length && (e = {
                        r: arguments[0],
                        g: arguments[1],
                        b: arguments[2]
                    },
                    t = arguments[3]),
                    this.process("colorize",
                    function(r) {
                        return r.r -= (r.r - e.r) * (t / 100),
                        r.g -= (r.g - e.g) * (t / 100),
                        r.b -= (r.b - e.b) * (t / 100),
                        r
                    })
                }),
                x.register("invert",
                function() {
                    return this.process("invert",
                    function(t) {
                        return t.r = 255 - t.r,
                        t.g = 255 - t.g,
                        t.b = 255 - t.b,
                        t
                    })
                }),
                x.register("sepia",
                function(t) {
                    return null == t && (t = 100),
                    t /= 100,
                    this.process("sepia",
                    function(e) {
                        return e.r = Math.min(255, e.r * (1 - .607 * t) + e.g * (.769 * t) + e.b * (.189 * t)),
                        e.g = Math.min(255, e.r * (.349 * t) + e.g * (1 - .314 * t) + e.b * (.168 * t)),
                        e.b = Math.min(255, e.r * (.272 * t) + e.g * (.534 * t) + e.b * (1 - .869 * t)),
                        e
                    })
                }),
                x.register("gamma",
                function(t) {
                    return this.process("gamma",
                    function(e) {
                        return e.r = 255 * Math.pow(e.r / 255, t),
                        e.g = 255 * Math.pow(e.g / 255, t),
                        e.b = 255 * Math.pow(e.b / 255, t),
                        e
                    })
                }),
                x.register("noise",
                function(t) {
                    return t = 2.55 * Math.abs(t),
                    this.process("noise",
                    function(e) {
                        var r;
                        return r = h.randomRange(t * -1, t),
                        e.r += r,
                        e.g += r,
                        e.b += r,
                        e
                    })
                }),
                x.register("clip",
                function(t) {
                    return t = 2.55 * Math.abs(t),
                    this.process("clip",
                    function(e) {
                        return e.r > 255 - t ? e.r = 255 : e.r < t && (e.r = 0),
                        e.g > 255 - t ? e.g = 255 : e.g < t && (e.g = 0),
                        e.b > 255 - t ? e.b = 255 : e.b < t && (e.b = 0),
                        e
                    })
                }),
                x.register("channels",
                function(t) {
                    var e, r;
                    if ("object" !== ("undefined" == typeof t ? "undefined": (0, s.
                default)(t))) return this;
                    for (e in t) I.call(t, e) && (r = t[e], 0 !== r ? t[e] /= 100 : delete t[e]);
                    return 0 === t.length ? this: this.process("channels",
                    function(e) {
                        return null != t.red && (t.red > 0 ? e.r += (255 - e.r) * t.red: e.r -= e.r * Math.abs(t.red)),
                        null != t.green && (t.green > 0 ? e.g += (255 - e.g) * t.green: e.g -= e.g * Math.abs(t.green)),
                        null != t.blue && (t.blue > 0 ? e.b += (255 - e.b) * t.blue: e.b -= e.b * Math.abs(t.blue)),
                        e
                    })
                }),
                x.register("curves",
                function() {
                    var t, e, r, i, n, o, a, s, l, c, u, g;
                    if (r = arguments[0], i = 2 <= arguments.length ? M.call(arguments, 1) : [], a = i[i.length - 1], "function" == typeof a ? (t = a, i.pop()) : "string" == typeof a ? (t = h[a], i.pop()) : t = h.bezier, "string" == typeof r && (r = r.split("")), "v" === r[0] && (r = ["r", "g", "b"]), i.length < 2) throw "Invalid number of arguments to curves filter";
                    if (e = t(i, 0, 255), s = i[0], s[0] > 0) for (o = l = 0, u = s[0]; 0 <= u ? l < u: l > u; o = 0 <= u ? ++l: --l) e[o] = s[1];
                    if (n = i[i.length - 1], n[0] < 255) for (o = c = g = n[0]; g <= 255 ? c <= 255 : c >= 255; o = g <= 255 ? ++c: --c) e[o] = n[1];
                    return this.process("curves",
                    function(t) {
                        var i, n;
                        for (o = i = 0, n = r.length; 0 <= n ? i < n: i > n; o = 0 <= n ? ++i: --i) t[r[o]] = e[t[r[o]]];
                        return t
                    })
                }),
                x.register("exposure",
                function(t) {
                    var e, r, i;
                    return i = Math.abs(t) / 100,
                    e = [0, 255 * i],
                    r = [255 - 255 * i, 255],
                    t < 0 && (e = e.reverse(), r = r.reverse()),
                    this.curves("rgb", [0, 0], e, r, [255, 255])
                }),
                c.Plugin.register("crop",
                function(t, r, i, n) {
                    var o, a;
                    return null == i && (i = 0),
                    null == n && (n = 0),
                    "undefined" != typeof e && null !== e ? o = new g(t, r) : (o = document.createElement("canvas"), _.copyAttributes(this.canvas, o), o.width = t, o.height = r),
                    a = o.getContext("2d"),
                    a.drawImage(this.canvas, i, n, t, r, 0, 0, t, r),
                    this.cropCoordinates = {
                        x: i,
                        y: n
                    },
                    this.cropped = !0,
                    this.replaceCanvas(o)
                }),
                c.Plugin.register("resize",
                function(t) {
                    var r, i;
                    return null == t && (t = null),
                    null === t || null == t.width && null == t.height ? void y.error("Invalid or missing dimensions given for resize") : (null == t.width ? t.width = this.canvas.width * t.height / this.canvas.height: null == t.height && (t.height = this.canvas.height * t.width / this.canvas.width), "undefined" != typeof e && null !== e ? r = new g(t.width, t.height) : (r = document.createElement("canvas"), _.copyAttributes(this.canvas, r), r.width = t.width, r.height = t.height), i = r.getContext("2d"), i.drawImage(this.canvas, 0, 0, this.canvas.width, this.canvas.height, 0, 0, t.width, t.height), this.resized = !0, this.replaceCanvas(r))
                }),
                c.Filter.register("crop",
                function() {
                    return this.processPlugin("crop", Array.prototype.slice.call(arguments, 0))
                }),
                c.Filter.register("resize",
                function() {
                    return this.processPlugin("resize", Array.prototype.slice.call(arguments, 0))
                }),
                c.Filter.register("boxBlur",
                function() {
                    return this.processKernel("Box Blur", [1, 1, 1, 1, 1, 1, 1, 1, 1])
                }),
                c.Filter.register("heavyRadialBlur",
                function() {
                    return this.processKernel("Heavy Radial Blur", [0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0])
                }),
                c.Filter.register("gaussianBlur",
                function() {
                    return this.processKernel("Gaussian Blur", [1, 4, 6, 4, 1, 4, 16, 24, 16, 4, 6, 24, 36, 24, 6, 4, 16, 24, 16, 4, 1, 4, 6, 4, 1])
                }),
                c.Filter.register("motionBlur",
                function(t) {
                    var e;
                    return e = 0 === t || 180 === t ? [0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0] : t > 0 && t < 90 || t > 180 && t < 270 ? [0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0] : 90 === t || 270 === t ? [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] : [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1],
                    this.processKernel("Motion Blur", e)
                }),
                c.Filter.register("sharpen",
                function(t) {
                    return null == t && (t = 100),
                    t /= 100,
                    this.processKernel("Sharpen", [0, -t, 0, -t, 4 * t + 1, -t, 0, -t, 0])
                }),
                P = {
                    brightness: function(t, e, r) {
                        return t.r = t.r - t.r * e * r.strength,
                        t.g = t.g - t.g * e * r.strength,
                        t.b = t.b - t.b * e * r.strength,
                        t
                    },
                    gamma: function(t, e, r) {
                        return t.r = 255 * Math.pow(t.r / 255, Math.max(10 * e * r.strength, 1)),
                        t.g = 255 * Math.pow(t.g / 255, Math.max(10 * e * r.strength, 1)),
                        t.b = 255 * Math.pow(t.b / 255, Math.max(10 * e * r.strength, 1)),
                        t
                    },
                    colorize: function(t, e, r) {
                        return t.r -= (t.r - r.color.r) * e,
                        t.g -= (t.g - r.color.g) * e,
                        t.b -= (t.b - r.color.b) * e,
                        t
                    }
                },
                x.register("vignette",
                function(t, e) {
                    var r, i, n, o;
                    return null == e && (e = 60),
                    "string" == typeof t && "%" === t.substr( - 1) && (t = this.dimensions.height > this.dimensions.width ? this.dimensions.width * (parseInt(t.substr(0, t.length - 1), 10) / 100) : this.dimensions.height * (parseInt(t.substr(0, t.length - 1), 10) / 100)),
                    e /= 100,
                    i = [this.dimensions.width / 2, this.dimensions.height / 2],
                    o = Math.sqrt(Math.pow(i[0], 2) + Math.pow(i[1], 2)),
                    n = o - t,
                    r = h.bezier([0, 1], [30, 30], [70, 60], [100, 80]),
                    this.process("vignette",
                    function(o) {
                        var a, s, l;
                        return l = o.locationXY(),
                        a = h.distance(l.x, l.y, i[0], i[1]),
                        a > n && (s = Math.max(1, r[Math.round((a - n) / t * 100)] / 10 * e), o.r = 255 * Math.pow(o.r / 255, s), o.g = 255 * Math.pow(o.g / 255, s), o.b = 255 * Math.pow(o.b / 255, s)),
                        o
                    })
                }),
                x.register("rectangularVignette",
                function(t) {
                    var e, r, i, n, o, a, l;
                    if (e = {
                        strength: 50,
                        cornerRadius: 0,
                        method: "brightness",
                        color: {
                            r: 0,
                            g: 0,
                            b: 0
                        }
                    },
                    t = _.extend(e, t), !t.size) return this;
                    if ("string" == typeof t.size) i = parseInt(t.size, 10) / 100,
                    t.size = {
                        width: this.dimensions.width * i,
                        height: this.dimensions.height * i
                    };
                    else if ("object" === (0, s.
                default)(t.size)) for (l = ["width", "height"], o = 0, a = l.length; o < a; o++) r = l[o],
                    "string" == typeof t.size[r] && (t.size[r] = this.dimensions[r] * (parseInt(t.size[r], 10) / 100));
                    else "number" === t.size && (n = t.size, t.size = {
                        width: n,
                        height: n
                    });
                    return "string" == typeof t.cornerRadius && (t.cornerRadius = t.size.width / 2 * (parseInt(t.cornerRadius, 10) / 100)),
                    t.strength /= 100,
                    t.size.width = Math.floor(t.size.width),
                    t.size.height = Math.floor(t.size.height),
                    t.image = {
                        width: this.dimensions.width,
                        height: this.dimensions.height
                    },
                    "colorize" === t.method && "string" == typeof t.color && (t.color = d.hexToRGB(t.color)),
                    t.coords = {
                        left: (this.dimensions.width - t.size.width) / 2,
                        right: this.dimensions.width - t.coords.left,
                        bottom: (this.dimensions.height - t.size.height) / 2,
                        top: this.dimensions.height - t.coords.bottom
                    },
                    t.corners = [{
                        x: t.coords.left + t.cornerRadius,
                        y: t.coords.top - t.cornerRadius
                    },
                    {
                        x: t.coords.right - t.cornerRadius,
                        y: t.coords.top - t.cornerRadius
                    },
                    {
                        x: t.coords.right - t.cornerRadius,
                        y: t.coords.bottom + t.cornerRadius
                    },
                    {
                        x: t.coords.left + t.cornerRadius,
                        y: t.coords.bottom + t.cornerRadius
                    }],
                    t.maxDist = h.distance(0, 0, t.corners[3].x, t.corners[3].y) - t.cornerRadius,
                    this.process("rectangularVignette",
                    function(e) {
                        var r, i, n;
                        return i = e.locationXY(),
                        i.x > t.corners[0].x && i.x < t.corners[1].x && i.y > t.coords.bottom && i.y < t.coords.top ? e: i.x > t.coords.left && i.x < t.coords.right && i.y > t.corners[3].y && i.y < t.corners[2].y ? e: (i.x > t.corners[0].x && i.x < t.corners[1].x && i.y > t.coords.top ? r = (i.y - t.coords.top) / t.maxDist: i.y > t.corners[2].y && i.y < t.corners[1].y && i.x > t.coords.right ? r = (i.x - t.coords.right) / t.maxDist: i.x > t.corners[0].x && i.x < t.corners[1].x && i.y < t.coords.bottom ? r = (t.coords.bottom - i.y) / t.maxDist: i.y > t.corners[2].y && i.y < t.corners[1].y && i.x < t.coords.left ? r = (t.coords.left - i.x) / t.maxDist: i.x <= t.corners[0].x && i.y >= t.corners[0].y ? (n = c.distance(i.x, i.y, t.corners[0].x, t.corners[0].y), r = (n - t.cornerRadius) / t.maxDist) : i.x >= t.corners[1].x && i.y >= t.corners[1].y ? (n = c.distance(i.x, i.y, t.corners[1].x, t.corners[1].y), r = (n - t.cornerRadius) / t.maxDist) : i.x >= t.corners[2].x && i.y <= t.corners[2].y ? (n = c.distance(i.x, i.y, t.corners[2].x, t.corners[2].y), r = (n - t.cornerRadius) / t.maxDist) : i.x <= t.corners[3].x && i.y <= t.corners[3].y && (n = c.distance(i.x, i.y, t.corners[3].x, t.corners[3].y), r = (n - t.cornerRadius) / t.maxDist), r < 0 ? e: P[t.method](e, r, t))
                    })
                }),
                function() {
                    var t, r, i, n, o;
                    return n = [512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259, 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381, 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309, 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259, 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442, 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381, 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332, 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292, 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259],
                    o = [9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24],
                    r = function(t, r, i, n, o, a, s) {
                        var h, l, c, u, d, f, p;
                        return h = "undefined" != typeof e && null !== e ? new g: document.createElement("canvas"),
                        h.width = t,
                        h.height = r,
                        u = i + Math.cos(o) * a * .5,
                        f = n + Math.sin(o) * a * .5,
                        d = i - Math.cos(o) * a * .5,
                        p = n - Math.sin(o) * a * .5,
                        l = h.getContext("2d"),
                        c = l.createLinearGradient(u, f, d, p),
                        s ? (c.addColorStop(0, "white"), c.addColorStop(.5, "black"), c.addColorStop(1, "white")) : (c.addColorStop(0, "white"), c.addColorStop(1, "black")),
                        l.fillStyle = c,
                        l.fillRect(0, 0, t, r),
                        l.getImageData(0, 0, t, r)
                    },
                    i = function(t, r, i, n, o, a) {
                        var s, h, l;
                        return s = "undefined" != typeof e && null !== e ? new g: document.createElement("canvas"),
                        s.width = t,
                        s.height = r,
                        h = s.getContext("2d"),
                        l = h.createRadialGradient(i, n, o, i, n, a),
                        l.addColorStop(1, "white"),
                        l.addColorStop(0, "black"),
                        h.fillStyle = l,
                        h.fillRect(0, 0, t, r),
                        h.getImageData(0, 0, t, r)
                    },
                    t = function() {
                        return this.r = 0,
                        this.g = 0,
                        this.b = 0,
                        this.a = 0,
                        this.next = null
                    },
                    c.Plugin.register("compoundBlur",
                    function(e, r, i, a) {
                        var s, h, l, c, u, g, d, f, p, x, m, v, b, y, w, D, R, T, C, E, _, S, F, A, P, B, M, I, L, z, k, U, N, O, G, X, W, j, J, H, Y, q, K, V, Q, $, Z, tt, et, rt, it, nt, ot, at, st, ht, lt, ct;
                        for (q = this.dimensions.width, x = this.dimensions.height, w = this.pixelData, I = e.data, H = q * x, Y = H << 2, F = [], v = et = 0; 0 <= Y ? et < Y: et > Y; v = 0 <= Y ? ++et: --et) F[v] = w[v];
                        for (u = 0, W = a, a -= 1; W-->=0;) if (R = r + .5 | 0, 0 !== R) {
                            for (R > 256 && (R = 256), g = R + R + 1, J = q << 2, K = q - 1, m = x - 1, L = R + 1, j = L * (L + 1) / 2, X = new t, N = void 0, U = X, v = rt = 1; 1 <= g ? rt < g: rt > g; v = 1 <= g ? ++rt: --rt) U = U.next = new t,
                            v === L && (N = U);
                            for (U.next = X, O = null, G = null, tt = $ = 0, C = n[R], k = o[R], Q = it = 0; 0 <= x ? it < x: it > x; Q = 0 <= x ? ++it: --it) {
                                for (P = d = s = M = p = l = 0, B = L * (A = F[$]), f = L * (S = F[$ + 1]), h = L * (_ = F[$ + 2]), M += j * A, p += j * S, l += j * _, U = X, v = nt = 0; 0 <= L ? nt < L: nt > L; v = 0 <= L ? ++nt: --nt) U.r = A,
                                U.g = S,
                                U.b = _,
                                U = U.next;
                                for (v = ot = 1; 1 <= L ? ot < L: ot > L; v = 1 <= L ? ++ot: --ot) E = $ + ((K < v ? K: v) << 2),
                                M += (U.r = A = F[E]) * (z = L - v),
                                p += (U.g = S = F[E + 1]) * z,
                                l += (U.b = _ = F[E + 2]) * z,
                                P += A,
                                d += S,
                                s += _,
                                U = U.next;
                                for (O = X, G = N, V = at = 0; 0 <= q ? at < q: at > q; V = 0 <= q ? ++at: --at) F[$] = M * C >> k,
                                F[$ + 1] = p * C >> k,
                                F[$ + 2] = l * C >> k,
                                M -= B,
                                p -= f,
                                l -= h,
                                B -= O.r,
                                f -= O.g,
                                h -= O.b,
                                E = tt + ((E = V + L) < K ? E: K) << 2,
                                P += O.r = F[E],
                                d += O.g = F[E + 1],
                                s += O.b = F[E + 2],
                                M += P,
                                p += d,
                                l += s,
                                O = O.next,
                                B += A = G.r,
                                f += S = G.g,
                                h += _ = G.b,
                                P -= A,
                                d -= S,
                                s -= _,
                                G = G.next,
                                $ += 4;
                                tt += q
                            }
                            for (V = st = 0; 0 <= q ? st < q: st > q; V = 0 <= q ? ++st: --st) {
                                for (d = s = P = p = l = M = 0, $ = V << 2, B = L * (A = F[$]), f = L * (S = F[$ + 1]), h = L * (_ = F[$ + 2]), M += j * A, p += j * S, l += j * _, U = X, v = ht = 0; 0 <= L ? ht < L: ht > L; v = 0 <= L ? ++ht: --ht) U.r = A,
                                U.g = S,
                                U.b = _,
                                U = U.next;
                                for (Z = q, v = lt = 1; 1 <= L ? lt < L: lt > L; v = 1 <= L ? ++lt: --lt) $ = Z + V << 2,
                                M += (U.r = A = F[$]) * (z = L - v),
                                p += (U.g = S = F[$ + 1]) * z,
                                l += (U.b = _ = F[$ + 2]) * z,
                                P += A,
                                d += S,
                                s += _,
                                U = U.next,
                                v < m && (Z += q);
                                for ($ = V, O = X, G = N, Q = ct = 0; 0 <= x ? ct < x: ct > x; Q = 0 <= x ? ++ct: --ct) E = $ << 2,
                                F[E] = M * C >> k,
                                F[E + 1] = p * C >> k,
                                F[E + 2] = l * C >> k,
                                M -= B,
                                p -= f,
                                l -= h,
                                B -= O.r,
                                f -= O.g,
                                h -= O.b,
                                E = V + ((E = Q + L) < m ? E: m) * q << 2,
                                M += P += O.r = F[E],
                                p += d += O.g = F[E + 1],
                                l += s += O.b = F[E + 2],
                                O = O.next,
                                B += A = G.r,
                                f += S = G.g,
                                h += _ = G.b,
                                P -= A,
                                d -= S,
                                s -= _,
                                G = G.next,
                                $ += q
                            }
                            for (r *= i, v = H; --v > -1;) y = v << 2,
                            T = (255 & I[y + 2]) / 255 * a,
                            D = 0 | T,
                            D === u ? (c = 256 * (T - (0 | T)), b = 256 - c, w[y] = w[y] * b + F[y] * c >> 8, w[y + 1] = w[y + 1] * b + F[y + 1] * c >> 8, w[y + 2] = w[y + 2] * b + F[y + 2] * c >> 8) : D === u + 1 && (w[y] = F[y], w[y + 1] = F[y + 1], w[y + 2] = F[y + 2]);
                            u++
                        }
                        return this
                    }),
                    c.Filter.register("tiltShift",
                    function(t) {
                        var e, i;
                        return e = {
                            center: {
                                x: this.dimensions.width / 2,
                                y: this.dimensions.height / 2
                            },
                            angle: 45,
                            focusWidth: 200,
                            startRadius: 3,
                            radiusFactor: 1.5,
                            steps: 3
                        },
                        t = _.extend(e, t),
                        t.angle *= Math.PI / 180,
                        i = r(this.dimensions.width, this.dimensions.height, t.center.x, t.center.y, t.angle, t.focusWidth, !0),
                        this.processPlugin("compoundBlur", [i, t.startRadius, t.radiusFactor, t.steps])
                    }),
                    c.Filter.register("radialBlur",
                    function(t) {
                        var e, r, n, o;
                        return e = {
                            size: 50,
                            center: {
                                x: this.dimensions.width / 2,
                                y: this.dimensions.height / 2
                            },
                            startRadius: 3,
                            radiusFactor: 1.5,
                            steps: 3,
                            radius: null
                        },
                        t = _.extend(e, t),
                        t.radius || (t.radius = this.dimensions.width < this.dimensions.height ? this.dimensions.height: this.dimensions.width),
                        n = t.radius / 2 - t.size,
                        o = t.radius / 2,
                        r = i(this.dimensions.width, this.dimensions.height, t.center.x, t.center.y, n, o),
                        this.processPlugin("compoundBlur", [r, t.startRadius, t.radiusFactor, t.steps])
                    })
                } (),
                c.Filter.register("edgeEnhance",
                function() {
                    return this.processKernel("Edge Enhance", [0, 0, 0, -1, 1, 0, 0, 0, 0])
                }),
                c.Filter.register("edgeDetect",
                function() {
                    return this.processKernel("Edge Detect", [ - 1, -1, -1, -1, 8, -1, -1, -1, -1])
                }),
                c.Filter.register("emboss",
                function() {
                    return this.processKernel("Emboss", [ - 2, -1, 0, -1, 1, 1, 0, 1, 2])
                }),
                c.Filter.register("posterize",
                function(t) {
                    var e, r;
                    return e = 256 / t,
                    r = 255 / (t - 1),
                    this.process("posterize",
                    function(t) {
                        return t.r = Math.floor(Math.floor(t.r / e) * r),
                        t.g = Math.floor(Math.floor(t.g / e) * r),
                        t.b = Math.floor(Math.floor(t.b / e) * r),
                        t
                    })
                }),
                c.Filter.register("vintage",
                function(t) {
                    if (null == t && (t = !0), this.greyscale(), this.contrast(5), this.noise(3), this.sepia(100), this.channels({
                        red: 8,
                        blue: 2,
                        green: 4
                    }), this.gamma(.87), t) return this.vignette("40%", 30)
                }),
                c.Filter.register("lomo",
                function(t) {
                    return null == t && (t = !0),
                    this.brightness(15),
                    this.exposure(15),
                    this.curves("rgb", [0, 0], [200, 0], [155, 255], [255, 255]),
                    this.saturation( - 20),
                    this.gamma(1.8),
                    t && this.vignette("50%", 60),
                    this.brightness(5)
                }),
                c.Filter.register("clarity",
                function(t) {
                    return null == t && (t = !1),
                    this.vibrance(20),
                    this.curves("rgb", [5, 0], [130, 150], [190, 220], [250, 255]),
                    this.sharpen(15),
                    this.vignette("45%", 20),
                    t && (this.greyscale(), this.contrast(4)),
                    this
                }),
                c.Filter.register("sinCity",
                function() {
                    return this.contrast(100),
                    this.brightness(15),
                    this.exposure(10),
                    this.posterize(80),
                    this.clip(30),
                    this.greyscale()
                }),
                c.Filter.register("sunrise",
                function() {
                    return this.exposure(3.5),
                    this.saturation( - 5),
                    this.vibrance(50),
                    this.sepia(60),
                    this.colorize("#e87b22", 10),
                    this.channels({
                        red: 8,
                        blue: 8
                    }),
                    this.contrast(5),
                    this.gamma(1.2),
                    this.vignette("55%", 25)
                }),
                c.Filter.register("crossProcess",
                function() {
                    return this.exposure(5),
                    this.colorize("#e87b22", 4),
                    this.sepia(20),
                    this.channels({
                        blue: 8,
                        red: 3
                    }),
                    this.curves("b", [0, 0], [100, 150], [180, 180], [255, 255]),
                    this.contrast(15),
                    this.vibrance(75),
                    this.gamma(1.6)
                }),
                c.Filter.register("orangePeel",
                function() {
                    return this.curves("rgb", [0, 0], [100, 50], [140, 200], [255, 255]),
                    this.vibrance( - 30),
                    this.saturation( - 30),
                    this.colorize("#ff9000", 30),
                    this.contrast( - 5),
                    this.gamma(1.4)
                }),
                c.Filter.register("love",
                function() {
                    return this.brightness(5),
                    this.exposure(8),
                    this.contrast(4),
                    this.colorize("#c42007", 30),
                    this.vibrance(50),
                    this.gamma(1.3)
                }),
                c.Filter.register("grungy",
                function() {
                    return this.gamma(1.5),
                    this.clip(25),
                    this.saturation( - 60),
                    this.contrast(5),
                    this.noise(5),
                    this.vignette("50%", 30)
                }),
                c.Filter.register("jarques",
                function() {
                    return this.saturation( - 35),
                    this.curves("b", [20, 0], [90, 120], [186, 144], [255, 230]),
                    this.curves("r", [0, 0], [144, 90], [138, 120], [255, 255]),
                    this.curves("g", [10, 0], [115, 105], [148, 100], [255, 248]),
                    this.curves("rgb", [0, 0], [120, 100], [128, 140], [255, 255]),
                    this.sharpen(20)
                }),
                c.Filter.register("pinhole",
                function() {
                    return this.greyscale(),
                    this.sepia(10),
                    this.exposure(10),
                    this.contrast(15),
                    this.vignette("60%", 35)
                }),
                c.Filter.register("oldBoot",
                function() {
                    return this.saturation( - 20),
                    this.vibrance( - 50),
                    this.gamma(1.1),
                    this.sepia(30),
                    this.channels({
                        red: -10,
                        blue: 5
                    }),
                    this.curves("rgb", [0, 0], [80, 50], [128, 230], [255, 255]),
                    this.vignette("60%", 30)
                }),
                c.Filter.register("glowingSun",
                function(t) {
                    if (null == t && (t = !0), this.brightness(10), this.newLayer(function() {
                        return this.setBlendingMode("multiply"),
                        this.opacity(80),
                        this.copyParent(),
                        this.filter.gamma(.8),
                        this.filter.contrast(50),
                        this.filter.exposure(10)
                    }), this.newLayer(function() {
                        return this.setBlendingMode("softLight"),
                        this.opacity(80),
                        this.fillColor("#f49600")
                    }), this.exposure(20), this.gamma(.8), t) return this.vignette("45%", 20)
                }),
                c.Filter.register("hazyDays",
                function() {
                    return this.gamma(1.2),
                    this.newLayer(function() {
                        return this.setBlendingMode("overlay"),
                        this.opacity(60),
                        this.copyParent(),
                        this.filter.channels({
                            red: 5
                        }),
                        this.filter.stackBlur(15)
                    }),
                    this.newLayer(function() {
                        return this.setBlendingMode("addition"),
                        this.opacity(40),
                        this.fillColor("#6899ba")
                    }),
                    this.newLayer(function() {
                        return this.setBlendingMode("multiply"),
                        this.opacity(35),
                        this.copyParent(),
                        this.filter.brightness(40),
                        this.filter.vibrance(40),
                        this.filter.exposure(30),
                        this.filter.contrast(15),
                        this.filter.curves("r", [0, 40], [128, 128], [128, 128], [255, 215]),
                        this.filter.curves("g", [0, 40], [128, 128], [128, 128], [255, 215]),
                        this.filter.curves("b", [0, 40], [128, 128], [128, 128], [255, 215]),
                        this.filter.stackBlur(5)
                    }),
                    this.curves("r", [20, 0], [128, 158], [128, 128], [235, 255]),
                    this.curves("g", [20, 0], [128, 128], [128, 128], [235, 255]),
                    this.curves("b", [20, 0], [128, 108], [128, 128], [235, 255]),
                    this.vignette("45%", 20)
                }),
                c.Filter.register("herMajesty",
                function() {
                    return this.brightness(40),
                    this.colorize("#ea1c5d", 10),
                    this.curves("b", [0, 10], [128, 180], [190, 190], [255, 255]),
                    this.newLayer(function() {
                        return this.setBlendingMode("overlay"),
                        this.opacity(50),
                        this.copyParent(),
                        this.filter.gamma(.7),
                        this.newLayer(function() {
                            return this.setBlendingMode("normal"),
                            this.opacity(60),
                            this.fillColor("#ea1c5d")
                        })
                    }),
                    this.newLayer(function() {
                        return this.setBlendingMode("multiply"),
                        this.opacity(60),
                        this.copyParent(),
                        this.filter.saturation(50),
                        this.filter.hue(90),
                        this.filter.contrast(10)
                    }),
                    this.gamma(1.4),
                    this.vibrance( - 30),
                    this.newLayer(function() {
                        return this.opacity(10),
                        this.fillColor("#e5f0ff")
                    }),
                    this
                }),
                c.Filter.register("nostalgia",
                function() {
                    return this.saturation(20),
                    this.gamma(1.4),
                    this.greyscale(),
                    this.contrast(5),
                    this.sepia(100),
                    this.channels({
                        red: 8,
                        blue: 2,
                        green: 4
                    }),
                    this.gamma(.8),
                    this.contrast(5),
                    this.exposure(10),
                    this.newLayer(function() {
                        return this.setBlendingMode("overlay"),
                        this.copyParent(),
                        this.opacity(55),
                        this.filter.stackBlur(10)
                    }),
                    this.vignette("50%", 30)
                }),
                c.Filter.register("hemingway",
                function() {
                    return this.greyscale(),
                    this.contrast(10),
                    this.gamma(.9),
                    this.newLayer(function() {
                        return this.setBlendingMode("multiply"),
                        this.opacity(40),
                        this.copyParent(),
                        this.filter.exposure(15),
                        this.filter.contrast(15),
                        this.filter.channels({
                            green: 10,
                            red: 5
                        })
                    }),
                    this.sepia(30),
                    this.curves("rgb", [0, 10], [120, 90], [180, 200], [235, 255]),
                    this.channels({
                        red: 5,
                        green: -2
                    }),
                    this.exposure(15)
                }),
                c.Filter.register("concentrate",
                function() {
                    return this.sharpen(40),
                    this.saturation( - 50),
                    this.channels({
                        red: 3
                    }),
                    this.newLayer(function() {
                        return this.setBlendingMode("multiply"),
                        this.opacity(80),
                        this.copyParent(),
                        this.filter.sharpen(5),
                        this.filter.contrast(50),
                        this.filter.exposure(10),
                        this.filter.channels({
                            blue: 5
                        })
                    }),
                    this.brightness(10)
                }),
                c.Plugin.register("rotate",
                function(t) {
                    var r, i, n, o, a, s, h, l;
                    return r = t % 360,
                    0 === r ? this.dimensions = {
                        width: this.canvas.width,
                        height: this.canvas.height
                    }: (a = Math.PI / 180, "undefined" != typeof e && null !== e ? i = new g: (i = document.createElement("canvas"), _.copyAttributes(this.canvas, i)), 90 === r || r === -270 || 270 === r || r === -90 ? (s = this.canvas.height, o = this.canvas.width, h = s / 2, l = o / 2) : 180 === r ? (s = this.canvas.width, o = this.canvas.height, h = s / 2, l = o / 2) : (s = Math.sqrt(Math.pow(this.originalWidth, 2) + Math.pow(this.originalHeight, 2)), o = s, h = this.canvas.height / 2, l = this.canvas.width / 2), i.width = s, i.height = o, n = i.getContext("2d"), n.save(), n.translate(h, l), n.rotate(r * a), n.drawImage(this.canvas, -this.canvas.width / 2, -this.canvas.height / 2, this.canvas.width, this.canvas.height), n.restore(), this.replaceCanvas(i))
                }),
                c.Filter.register("rotate",
                function() {
                    return this.processPlugin("rotate", Array.prototype.slice.call(arguments, 0))
                }),
                function() {
                    var t, e, r;
                    return e = [512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259, 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381, 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309, 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259, 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442, 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381, 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332, 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292, 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259],
                    r = [9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24],
                    t = function() {
                        return this.r = 0,
                        this.g = 0,
                        this.b = 0,
                        this.a = 0,
                        this.next = null
                    },
                    c.Plugin.register("stackBlur",
                    function(i) {
                        var n, o, a, s, h, l, c, u, g, d, f, p, x, m, v, b, y, w, D, R, T, C, E, _, S, F, A, P, B, M, I, L, z, k, U, N, O, G, X, W, j, J, H, Y, q;
                        if (! (isNaN(i) || i < 1)) {
                            for (i |= 0, v = this.pixelData, M = this.dimensions.width, u = this.dimensions.height, s = i + i + 1, B = M << 2, I = M - 1, g = u - 1, R = i + 1, P = R * (R + 1) / 2, A = new t, E = A, d = O = 1; 1 <= s ? O < s: O > s; d = 1 <= s ? ++O: --O) E = E.next = new t,
                            d === R && (_ = E);
                            for (E.next = A, S = null, F = null, N = k = 0, f = e[i], C = r[i], z = G = 0; 0 <= u ? G < u: G > u; z = 0 <= u ? ++G: --G) {
                                for (y = h = n = D = c = a = 0, w = R * (b = v[k]), l = R * (m = v[k + 1]), o = R * (x = v[k + 2]), D += P * b, c += P * m, a += P * x, E = A, d = X = 0; 0 <= R ? X < R: X > R; d = 0 <= R ? ++X: --X) E.r = b,
                                E.g = m,
                                E.b = x,
                                E = E.next;
                                for (d = W = 1; 1 <= R ? W < R: W > R; d = 1 <= R ? ++W: --W) p = k + ((I < d ? I: d) << 2),
                                D += (E.r = b = v[p]) * (T = R - d),
                                c += (E.g = m = v[p + 1]) * T,
                                a += (E.b = x = v[p + 2]) * T,
                                y += b,
                                h += m,
                                n += x,
                                E = E.next;
                                for (S = A, F = _, L = j = 0; 0 <= M ? j < M: j > M; L = 0 <= M ? ++j: --j) v[k] = D * f >> C,
                                v[k + 1] = c * f >> C,
                                v[k + 2] = a * f >> C,
                                D -= w,
                                c -= l,
                                a -= o,
                                w -= S.r,
                                l -= S.g,
                                o -= S.b,
                                p = N + ((p = L + i + 1) < I ? p: I) << 2,
                                y += S.r = v[p],
                                h += S.g = v[p + 1],
                                n += S.b = v[p + 2],
                                D += y,
                                c += h,
                                a += n,
                                S = S.next,
                                w += b = F.r,
                                l += m = F.g,
                                o += x = F.b,
                                y -= b,
                                h -= m,
                                n -= x,
                                F = F.next,
                                k += 4;
                                N += M
                            }
                            for (L = J = 0; 0 <= M ? J < M: J > M; L = 0 <= M ? ++J: --J) {
                                for (h = n = y = c = a = D = 0, k = L << 2, w = R * (b = v[k]), l = R * (m = v[k + 1]), o = R * (x = v[k + 2]), D += P * b, c += P * m, a += P * x, E = A, d = H = 0; 0 <= R ? H < R: H > R; d = 0 <= R ? ++H: --H) E.r = b,
                                E.g = m,
                                E.b = x,
                                E = E.next;
                                for (U = M, d = Y = 1; 1 <= i ? Y <= i: Y >= i; d = 1 <= i ? ++Y: --Y) k = U + L << 2,
                                D += (E.r = b = v[k]) * (T = R - d),
                                c += (E.g = m = v[k + 1]) * T,
                                a += (E.b = x = v[k + 2]) * T,
                                y += b,
                                h += m,
                                n += x,
                                E = E.next,
                                d < g && (U += M);
                                for (k = L, S = A, F = _, z = q = 0; 0 <= u ? q < u: q > u; z = 0 <= u ? ++q: --q) p = k << 2,
                                v[p] = D * f >> C,
                                v[p + 1] = c * f >> C,
                                v[p + 2] = a * f >> C,
                                D -= w,
                                c -= l,
                                a -= o,
                                w -= S.r,
                                l -= S.g,
                                o -= S.b,
                                p = L + ((p = z + R) < g ? p: g) * M << 2,
                                D += y += S.r = v[p],
                                c += h += S.g = v[p + 1],
                                a += n += S.b = v[p + 2],
                                S = S.next,
                                w += b = F.r,
                                l += m = F.g,
                                o += x = F.b,
                                y -= b,
                                h -= m,
                                n -= x,
                                F = F.next,
                                k += M
                            }
                            return this
                        }
                    }),
                    c.Filter.register("stackBlur",
                    function(t) {
                        return this.processPlugin("stackBlur", [t])
                    })
                } (),
                c.Filter.register("threshold",
                function(t) {
                    return this.process("threshold",
                    function(e) {
                        var r;
                        return r = .2126 * e.r + .7152 * e.g + .0722 * e.b,
                        r < t ? (e.r = 0, e.g = 0, e.b = 0) : (e.r = 255, e.g = 255, e.b = 255),
                        e
                    })
                })
            }).call(void 0)
        }).call(e, r(96).Buffer)
    },
    825 : function(t, e) {
        "use strict";
        window.fx = function() {
            function t(t, e, r) {
                return Math.max(t, Math.min(e, r))
            }
            function e(t) {
                return {
                    _: t,
                    loadContentsOf: function(t) {
                        O = this._.gl,
                        this._.loadContentsOf(t)
                    },
                    destroy: function() {
                        O = this._.gl,
                        this._.destroy()
                    }
                }
            }
            function r(t) {
                return e(X.fromElement(t))
            }
            function i(t, e) {
                var r = O.UNSIGNED_BYTE;
                if (O.getExtension("OES_texture_float") && O.getExtension("OES_texture_float_linear")) {
                    var i = new X(100, 100, O.RGBA, O.FLOAT);
                    try {
                        i.drawTo(function() {
                            r = O.FLOAT
                        })
                    } catch(t) {}
                    i.destroy()
                }
                this._.texture && this._.texture.destroy(),
                this._.spareTexture && this._.spareTexture.destroy(),
                this.width = t,
                this.height = e,
                this._.texture = new X(t, e, O.RGBA, r),
                this._.spareTexture = new X(t, e, O.RGBA, r),
                this._.extraTexture = this._.extraTexture || new X(0, 0, O.RGBA, r),
                this._.flippedShader = this._.flippedShader || new G(null, "uniform sampler2D texture;varying vec2 texCoord;void main(){gl_FragColor=texture2D(texture,vec2(texCoord.x,1.0-texCoord.y));}"),
                this._.isInitialized = !0
            }
            function n(t, e, r) {
                return this._.isInitialized && t._.width == this.width && t._.height == this.height || i.call(this, e ? e: t._.width, r ? r: t._.height),
                t._.use(),
                this._.texture.drawTo(function() {
                    G.getDefaultShader().drawRect()
                }),
                this
            }
            function o() {
                return this._.texture.use(),
                this._.flippedShader.drawRect(),
                this
            }
            function a(t, e, r, i) { (r || this._.texture).use(),
                this._.spareTexture.drawTo(function() {
                    t.uniforms(e).drawRect()
                }),
                this._.spareTexture.swapWith(i || this._.texture)
            }
            function s(t) {
                return t.parentNode.insertBefore(this, t),
                t.parentNode.removeChild(t),
                this
            }
            function h() {
                var t = new X(this._.texture.width, this._.texture.height, O.RGBA, O.UNSIGNED_BYTE);
                return this._.texture.use(),
                t.drawTo(function() {
                    G.getDefaultShader().drawRect()
                }),
                e(t)
            }
            function l() {
                var t = this._.texture.width,
                e = this._.texture.height,
                r = new Uint8Array(4 * t * e);
                return this._.texture.drawTo(function() {
                    O.readPixels(0, 0, t, e, O.RGBA, O.UNSIGNED_BYTE, r)
                }),
                r
            }
            function c(t) {
                return function() {
                    return O = this._.gl,
                    t.apply(this, arguments)
                }
            }
            function u(t, e, r, i, n, o, a, s) {
                var h = r - n,
                l = i - o,
                c = a - n,
                u = s - o;
                n = t - r + n - a,
                o = e - i + o - s;
                var g = h * u - c * l,
                c = (n * u - c * o) / g,
                h = (h * o - n * l) / g;
                return [r - t + c * r, i - e + c * i, c, a - t + h * a, s - e + h * s, h, t, e, 1]
            }
            function g(t) {
                var e = t[0],
                r = t[1],
                i = t[2],
                n = t[3],
                o = t[4],
                a = t[5],
                s = t[6],
                h = t[7];
                t = t[8];
                var l = e * o * t - e * a * h - r * n * t + r * a * s + i * n * h - i * o * s;
                return [(o * t - a * h) / l, (i * h - r * t) / l, (r * a - i * o) / l, (a * s - n * t) / l, (e * t - i * s) / l, (i * n - e * a) / l, (n * h - o * s) / l, (r * s - e * h) / l, (e * o - r * n) / l]
            }
            function d(t) {
                var e = t.length;
                this.xa = [],
                this.ya = [],
                this.u = [],
                this.y2 = [],
                t.sort(function(t, e) {
                    return t[0] - e[0]
                });
                for (var r = 0; r < e; r++) this.xa.push(t[r][0]),
                this.ya.push(t[r][1]);
                for (this.u[0] = 0, this.y2[0] = 0, r = 1; r < e - 1; ++r) {
                    t = this.xa[r + 1] - this.xa[r - 1];
                    var i = (this.xa[r] - this.xa[r - 1]) / t,
                    n = i * this.y2[r - 1] + 2;
                    this.y2[r] = (i - 1) / n,
                    this.u[r] = (6 * ((this.ya[r + 1] - this.ya[r]) / (this.xa[r + 1] - this.xa[r]) - (this.ya[r] - this.ya[r - 1]) / (this.xa[r] - this.xa[r - 1])) / t - i * this.u[r - 1]) / n
                }
                for (this.y2[e - 1] = 0, r = e - 2; 0 <= r; --r) this.y2[r] = this.y2[r] * this.y2[r + 1] + this.u[r]
            }
            function f(t, e) {
                return new G(null, t + "uniform sampler2D texture;uniform vec2 texSize;varying vec2 texCoord;void main(){vec2 coord=texCoord*texSize;" + e + "gl_FragColor=texture2D(texture,coord/texSize);vec2 clampedCoord=clamp(coord,vec2(0.0),texSize);if(coord!=clampedCoord){gl_FragColor.a*=max(0.0,1.0-length(coord-clampedCoord));}}")
            }
            function p(e, r) {
                return O.brightnessContrast = O.brightnessContrast || new G(null, "uniform sampler2D texture;uniform float brightness;uniform float contrast;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);color.rgb+=brightness;if(contrast>0.0){color.rgb=(color.rgb-0.5)/(1.0-contrast)+0.5;}else{color.rgb=(color.rgb-0.5)*(1.0+contrast)+0.5;}gl_FragColor=color;}"),
                a.call(this, O.brightnessContrast, {
                    brightness: t( - 1, e, 1),
                    contrast: t( - 1, r, 1)
                }),
                this
            }
            function x(e) {
                e = new d(e);
                for (var r = [], i = 0; 256 > i; i++) r.push(t(0, Math.floor(256 * e.interpolate(i / 255)), 255));
                return r
            }
            function m(t, e, r) {
                t = x(t),
                1 == arguments.length ? e = r = t: (e = x(e), r = x(r));
                for (var i = [], n = 0; 256 > n; n++) i.splice(i.length, 0, t[n], e[n], r[n], 255);
                return this._.extraTexture.initFromBytes(256, 1, i),
                this._.extraTexture.use(1),
                O.curves = O.curves || new G(null, "uniform sampler2D texture;uniform sampler2D map;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);color.r=texture2D(map,vec2(color.r)).r;color.g=texture2D(map,vec2(color.g)).g;color.b=texture2D(map,vec2(color.b)).b;gl_FragColor=color;}"),
                O.curves.textures({
                    map: 1
                }),
                a.call(this, O.curves, {}),
                this
            }
            function v(t) {
                O.denoise = O.denoise || new G(null, "uniform sampler2D texture;uniform float exponent;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;void main(){vec4 center=texture2D(texture,texCoord);vec4 color=vec4(0.0);float total=0.0;for(float x=-4.0;x<=4.0;x+=1.0){for(float y=-4.0;y<=4.0;y+=1.0){vec4 sample=texture2D(texture,texCoord+vec2(x,y)/texSize);float weight=1.0-abs(dot(sample.rgb-center.rgb,vec3(0.25)));weight=pow(weight,exponent);color+=sample*weight;total+=weight;}}gl_FragColor=color/total;}");
                for (var e = 0; 2 > e; e++) a.call(this, O.denoise, {
                    exponent: Math.max(0, t),
                    texSize: [this.width, this.height]
                });
                return this
            }
            function b(e, r) {
                return O.hueSaturation = O.hueSaturation || new G(null, "uniform sampler2D texture;uniform float hue;uniform float saturation;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float angle=hue*3.14159265;float s=sin(angle),c=cos(angle);vec3 weights=(vec3(2.0*c,-sqrt(3.0)*s-c,sqrt(3.0)*s-c)+1.0)/3.0;float len=length(color.rgb);color.rgb=vec3(dot(color.rgb,weights.xyz),dot(color.rgb,weights.zxy),dot(color.rgb,weights.yzx));float average=(color.r+color.g+color.b)/3.0;if(saturation>0.0){color.rgb+=(average-color.rgb)*(1.0-1.0/(1.001-saturation));}else{color.rgb+=(average-color.rgb)*(-saturation);}gl_FragColor=color;}"),
                a.call(this, O.hueSaturation, {
                    hue: t( - 1, e, 1),
                    saturation: t( - 1, r, 1)
                }),
                this
            }
            function y(e) {
                return O.noise = O.noise || new G(null, "uniform sampler2D texture;uniform float amount;varying vec2 texCoord;float rand(vec2 co){return fract(sin(dot(co.xy,vec2(12.9898,78.233)))*43758.5453);}void main(){vec4 color=texture2D(texture,texCoord);float diff=(rand(texCoord)-0.5)*amount;color.r+=diff;color.g+=diff;color.b+=diff;gl_FragColor=color;}"),
                a.call(this, O.noise, {
                    amount: t(0, e, 1)
                }),
                this
            }
            function w(e) {
                return O.sepia = O.sepia || new G(null, "uniform sampler2D texture;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float r=color.r;float g=color.g;float b=color.b;color.r=min(1.0,(r*(1.0-(0.607*amount)))+(g*(0.769*amount))+(b*(0.189*amount)));color.g=min(1.0,(r*0.349*amount)+(g*(1.0-(0.314*amount)))+(b*0.168*amount));color.b=min(1.0,(r*0.272*amount)+(g*0.534*amount)+(b*(1.0-(0.869*amount))));gl_FragColor=color;}"),
                a.call(this, O.sepia, {
                    amount: t(0, e, 1)
                }),
                this
            }
            function D(e, r, i, n) {
                O.colorize = O.colorize || new G(null, " uniform sampler2D texture; uniform float amount; uniform float r; uniform float g; uniform float b; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); color.r -= (color.r - r) * (amount/100.0); color.g -= (color.g - g) * (amount/100.0); color.b -= (color.b - b) * (amount/100.0);  gl_FragColor = color; } "),
                a.call(this, O.colorize, {
                    r: t(0, e, 255),
                    g: t(0, r, 255),
                    b: t(0, i, 255),
                    amount: t(0, n, 1)
                })
            }
            function R(t, e) {
                return O.unsharpMask = O.unsharpMask || new G(null, "uniform sampler2D blurredTexture;uniform sampler2D originalTexture;uniform float strength;uniform float threshold;varying vec2 texCoord;void main(){vec4 blurred=texture2D(blurredTexture,texCoord);vec4 original=texture2D(originalTexture,texCoord);gl_FragColor=mix(blurred,original,1.0+strength);}"),
                this._.extraTexture.ensureFormat(this._.texture),
                this._.texture.use(),
                this._.extraTexture.drawTo(function() {
                    G.getDefaultShader().drawRect()
                }),
                this._.extraTexture.use(1),
                this.triangleBlur(t),
                O.unsharpMask.textures({
                    originalTexture: 1
                }),
                a.call(this, O.unsharpMask, {
                    strength: e
                }),
                this._.extraTexture.unuse(1),
                this
            }
            function T(e) {
                return O.vibrance = O.vibrance || new G(null, "uniform sampler2D texture;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float average=(color.r+color.g+color.b)/3.0;float mx=max(color.r,max(color.g,color.b));float amt=(mx-average)*(-amount*3.0);color.rgb=mix(color.rgb,vec3(mx),amt);gl_FragColor=color;}"),
                a.call(this, O.vibrance, {
                    amount: t( - 1, e, 1)
                }),
                this
            }
            function C(e, r) {
                return O.vignette = O.vignette || new G(null, "uniform sampler2D texture;uniform float size;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float dist=distance(texCoord,vec2(0.5,0.5));color.rgb*=smoothstep(0.8,size*0.799,dist*(amount+size));gl_FragColor=color;}"),
                a.call(this, O.vignette, {
                    size: t(0, e, 1),
                    amount: t(0, r, 1)
                }),
                this
            }
            function E(e, r, i) {
                O.lensBlurPrePass = O.lensBlurPrePass || new G(null, "uniform sampler2D texture;uniform float power;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);color=pow(color,vec4(power));gl_FragColor=vec4(color);}");
                var n = "uniform sampler2D texture0;uniform sampler2D texture1;uniform vec2 delta0;uniform vec2 delta1;uniform float power;varying vec2 texCoord;" + W + "vec4 sample(vec2 delta){float offset=random(vec3(delta,151.7182),0.0);vec4 color=vec4(0.0);float total=0.0;for(float t=0.0;t<=30.0;t++){float percent=(t+offset)/30.0;color+=texture2D(texture0,texCoord+delta*percent);total+=1.0;}return color/total;}";
                O.lensBlur0 = O.lensBlur0 || new G(null, n + "void main(){gl_FragColor=sample(delta0);}"),
                O.lensBlur1 = O.lensBlur1 || new G(null, n + "void main(){gl_FragColor=(sample(delta0)+sample(delta1))*0.5;}"),
                O.lensBlur2 = O.lensBlur2 || new G(null, n + "void main(){vec4 color=(sample(delta0)+2.0*texture2D(texture1,texCoord))/3.0;gl_FragColor=pow(color,vec4(power));}").textures({
                    texture1: 1
                });
                for (var n = [], o = 0; 3 > o; o++) {
                    var s = i + 2 * o * Math.PI / 3;
                    n.push([e * Math.sin(s) / this.width, e * Math.cos(s) / this.height])
                }
                return e = Math.pow(10, t( - 1, r, 1)),
                a.call(this, O.lensBlurPrePass, {
                    power: e
                }),
                this._.extraTexture.ensureFormat(this._.texture),
                a.call(this, O.lensBlur0, {
                    delta0: n[0]
                },
                this._.texture, this._.extraTexture),
                a.call(this, O.lensBlur1, {
                    delta0: n[1],
                    delta1: n[2]
                },
                this._.extraTexture, this._.extraTexture),
                a.call(this, O.lensBlur0, {
                    delta0: n[1]
                }),
                this._.extraTexture.use(1),
                a.call(this, O.lensBlur2, {
                    power: 1 / e,
                    delta0: n[2]
                }),
                this
            }
            function _(t, e, r, i, n, o) {
                O.tiltShift = O.tiltShift || new G(null, "uniform sampler2D texture;uniform float blurRadius;uniform float gradientRadius;uniform vec2 start;uniform vec2 end;uniform vec2 delta;uniform vec2 texSize;varying vec2 texCoord;" + W + "void main(){vec4 color=vec4(0.0);float total=0.0;float offset=random(vec3(12.9898,78.233,151.7182),0.0);vec2 normal=normalize(vec2(start.y-end.y,end.x-start.x));float radius=smoothstep(0.0,1.0,abs(dot(texCoord*texSize-start,normal))/gradientRadius)*blurRadius;for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec4 sample=texture2D(texture,texCoord+delta/texSize*percent*radius);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}");
                var s = r - t,
                h = i - e,
                l = Math.sqrt(s * s + h * h);
                return a.call(this, O.tiltShift, {
                    blurRadius: n,
                    gradientRadius: o,
                    start: [t, e],
                    end: [r, i],
                    delta: [s / l, h / l],
                    texSize: [this.width, this.height]
                }),
                a.call(this, O.tiltShift, {
                    blurRadius: n,
                    gradientRadius: o,
                    start: [t, e],
                    end: [r, i],
                    delta: [ - h / l, s / l],
                    texSize: [this.width, this.height]
                }),
                this
            }
            function S(t) {
                return O.triangleBlur = O.triangleBlur || new G(null, "uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;" + W + "void main(){vec4 color=vec4(0.0);float total=0.0;float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec4 sample=texture2D(texture,texCoord+delta*percent);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}"),
                a.call(this, O.triangleBlur, {
                    delta: [t / this.width, 0]
                }),
                a.call(this, O.triangleBlur, {
                    delta: [0, t / this.height]
                }),
                this
            }
            function F(t, e, r) {
                return O.zoomBlur = O.zoomBlur || new G(null, "uniform sampler2D texture;uniform vec2 center;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;" + W + "void main(){vec4 color=vec4(0.0);float total=0.0;vec2 toCenter=center-texCoord*texSize;float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=0.0;t<=40.0;t++){float percent=(t+offset)/40.0;float weight=4.0*(percent-percent*percent);vec4 sample=texture2D(texture,texCoord+toCenter*percent*strength/texSize);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}"),
                a.call(this, O.zoomBlur, {
                    center: [t, e],
                    strength: r,
                    texSize: [this.width, this.height]
                }),
                this
            }
            function A(t, e, r, i) {
                return O.colorHalftone = O.colorHalftone || new G(null, "uniform sampler2D texture;uniform vec2 center;uniform float angle;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;float pattern(float angle){float s=sin(angle),c=cos(angle);vec2 tex=texCoord*texSize-center;vec2 point=vec2(c*tex.x-s*tex.y,s*tex.x+c*tex.y)*scale;return(sin(point.x)*sin(point.y))*4.0;}void main(){vec4 color=texture2D(texture,texCoord);vec3 cmy=1.0-color.rgb;float k=min(cmy.x,min(cmy.y,cmy.z));cmy=(cmy-k)/(1.0-k);cmy=clamp(cmy*10.0-3.0+vec3(pattern(angle+0.26179),pattern(angle+1.30899),pattern(angle)),0.0,1.0);k=clamp(k*10.0-5.0+pattern(angle+0.78539),0.0,1.0);gl_FragColor=vec4(1.0-cmy-k,color.a);}"),
                a.call(this, O.colorHalftone, {
                    center: [t, e],
                    angle: r,
                    scale: Math.PI / i,
                    texSize: [this.width, this.height]
                }),
                this
            }
            function P(t, e, r, i) {
                return O.dotScreen = O.dotScreen || new G(null, "uniform sampler2D texture;uniform vec2 center;uniform float angle;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;float pattern(){float s=sin(angle),c=cos(angle);vec2 tex=texCoord*texSize-center;vec2 point=vec2(c*tex.x-s*tex.y,s*tex.x+c*tex.y)*scale;return(sin(point.x)*sin(point.y))*4.0;}void main(){vec4 color=texture2D(texture,texCoord);float average=(color.r+color.g+color.b)/3.0;gl_FragColor=vec4(vec3(average*10.0-5.0+pattern()),color.a);}"),
                a.call(this, O.dotScreen, {
                    center: [t, e],
                    angle: r,
                    scale: Math.PI / i,
                    texSize: [this.width, this.height]
                }),
                this
            }
            function B(t) {
                return O.edgeWork1 = O.edgeWork1 || new G(null, "uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;" + W + "void main(){vec2 color=vec2(0.0);vec2 total=vec2(0.0);float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec3 sample=texture2D(texture,texCoord+delta*percent).rgb;float average=(sample.r+sample.g+sample.b)/3.0;color.x+=average*weight;total.x+=weight;if(abs(t)<15.0){weight=weight*2.0-1.0;color.y+=average*weight;total.y+=weight;}}gl_FragColor=vec4(color/total,0.0,1.0);}"),
                O.edgeWork2 = O.edgeWork2 || new G(null, "uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;" + W + "void main(){vec2 color=vec2(0.0);vec2 total=vec2(0.0);float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec2 sample=texture2D(texture,texCoord+delta*percent).xy;color.x+=sample.x*weight;total.x+=weight;if(abs(t)<15.0){weight=weight*2.0-1.0;color.y+=sample.y*weight;total.y+=weight;}}float c=clamp(10000.0*(color.y/total.y-color.x/total.x)+0.5,0.0,1.0);gl_FragColor=vec4(c,c,c,1.0);}"),
                a.call(this, O.edgeWork1, {
                    delta: [t / this.width, 0]
                }),
                a.call(this, O.edgeWork2, {
                    delta: [0, t / this.height]
                }),
                this
            }
            function M(t, e, r) {
                return O.hexagonalPixelate = O.hexagonalPixelate || new G(null, "uniform sampler2D texture;uniform vec2 center;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;void main(){vec2 tex=(texCoord*texSize-center)/scale;tex.y/=0.866025404;tex.x-=tex.y*0.5;vec2 a;if(tex.x+tex.y-floor(tex.x)-floor(tex.y)<1.0)a=vec2(floor(tex.x),floor(tex.y));else a=vec2(ceil(tex.x),ceil(tex.y));vec2 b=vec2(ceil(tex.x),floor(tex.y));vec2 c=vec2(floor(tex.x),ceil(tex.y));vec3 TEX=vec3(tex.x,tex.y,1.0-tex.x-tex.y);vec3 A=vec3(a.x,a.y,1.0-a.x-a.y);vec3 B=vec3(b.x,b.y,1.0-b.x-b.y);vec3 C=vec3(c.x,c.y,1.0-c.x-c.y);float alen=length(TEX-A);float blen=length(TEX-B);float clen=length(TEX-C);vec2 choice;if(alen<blen){if(alen<clen)choice=a;else choice=c;}else{if(blen<clen)choice=b;else choice=c;}choice.x+=choice.y*0.5;choice.y*=0.866025404;choice*=scale/texSize;gl_FragColor=texture2D(texture,choice+center/texSize);}"),
                a.call(this, O.hexagonalPixelate, {
                    center: [t, e],
                    scale: r,
                    texSize: [this.width, this.height]
                }),
                this
            }
            function I(t) {
                return O.ink = O.ink || new G(null, "uniform sampler2D texture;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;void main(){vec2 dx=vec2(1.0/texSize.x,0.0);vec2 dy=vec2(0.0,1.0/texSize.y);vec4 color=texture2D(texture,texCoord);float bigTotal=0.0;float smallTotal=0.0;vec3 bigAverage=vec3(0.0);vec3 smallAverage=vec3(0.0);for(float x=-2.0;x<=2.0;x+=1.0){for(float y=-2.0;y<=2.0;y+=1.0){vec3 sample=texture2D(texture,texCoord+dx*x+dy*y).rgb;bigAverage+=sample;bigTotal+=1.0;if(abs(x)+abs(y)<2.0){smallAverage+=sample;smallTotal+=1.0;}}}vec3 edge=max(vec3(0.0),bigAverage/bigTotal-smallAverage/smallTotal);gl_FragColor=vec4(color.rgb-dot(edge,edge)*strength*100000.0,color.a);}"),
                a.call(this, O.ink, {
                    strength: t * t * t * t * t,
                    texSize: [this.width, this.height]
                }),
                this
            }
            function L(e, r, i, n) {
                return O.bulgePinch = O.bulgePinch || f("uniform float radius;uniform float strength;uniform vec2 center;", "coord-=center;float distance=length(coord);if(distance<radius){float percent=distance/radius;if(strength>0.0){coord*=mix(1.0,smoothstep(0.0,radius/distance,percent),strength*0.75);}else{coord*=mix(1.0,pow(percent,1.0+strength*0.75)*radius/distance,1.0-percent);}}coord+=center;"),
                a.call(this, O.bulgePinch, {
                    radius: i,
                    strength: t( - 1, n, 1),
                    center: [e, r],
                    texSize: [this.width, this.height]
                }),
                this
            }
            function z(t, e, r) {
                if (O.matrixWarp = O.matrixWarp || f("uniform mat3 matrix;uniform bool useTextureSpace;", "if(useTextureSpace)coord=coord/texSize*2.0-1.0;vec3 warp=matrix*vec3(coord,1.0);coord=warp.xy/warp.z;if(useTextureSpace)coord=(coord*0.5+0.5)*texSize;"), t = Array.prototype.concat.apply([], t), 4 == t.length) t = [t[0], t[1], 0, t[2], t[3], 0, 0, 0, 1];
                else if (9 != t.length) throw "can only warp with 2x2 or 3x3 matrix";
                return a.call(this, O.matrixWarp, {
                    matrix: e ? g(t) : t,
                    texSize: [this.width, this.height],
                    useTextureSpace: 0 | r
                }),
                this
            }
            function k(t, e) {
                var r = u.apply(null, e),
                i = u.apply(null, t),
                r = g(r);
                return this.matrixWarp([r[0] * i[0] + r[1] * i[3] + r[2] * i[6], r[0] * i[1] + r[1] * i[4] + r[2] * i[7], r[0] * i[2] + r[1] * i[5] + r[2] * i[8], r[3] * i[0] + r[4] * i[3] + r[5] * i[6], r[3] * i[1] + r[4] * i[4] + r[5] * i[7], r[3] * i[2] + r[4] * i[5] + r[5] * i[8], r[6] * i[0] + r[7] * i[3] + r[8] * i[6], r[6] * i[1] + r[7] * i[4] + r[8] * i[7], r[6] * i[2] + r[7] * i[5] + r[8] * i[8]])
            }
            function U(t, e, r, i) {
                return O.swirl = O.swirl || f("uniform float radius;uniform float angle;uniform vec2 center;", "coord-=center;float distance=length(coord);if(distance<radius){float percent=(radius-distance)/radius;float theta=percent*percent*angle;float s=sin(theta);float c=cos(theta);coord=vec2(coord.x*c-coord.y*s,coord.x*s+coord.y*c);}coord+=center;"),
                a.call(this, O.swirl, {
                    radius: r,
                    center: [t, e],
                    angle: i,
                    texSize: [this.width, this.height]
                }),
                this
            }
            var N = {}; !
            function() {
                function t(t) {
                    if (!t.getExtension("OES_texture_float")) return ! 1;
                    var e = t.createFramebuffer(),
                    r = t.createTexture();
                    t.bindTexture(t.TEXTURE_2D, r),
                    t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, t.NEAREST),
                    t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, t.NEAREST),
                    t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.CLAMP_TO_EDGE),
                    t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.CLAMP_TO_EDGE),
                    t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, 1, 1, 0, t.RGBA, t.UNSIGNED_BYTE, null),
                    t.bindFramebuffer(t.FRAMEBUFFER, e),
                    t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, r, 0),
                    e = t.createTexture(),
                    t.bindTexture(t.TEXTURE_2D, e),
                    t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, t.LINEAR),
                    t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, t.LINEAR),
                    t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.CLAMP_TO_EDGE),
                    t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.CLAMP_TO_EDGE),
                    t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, 2, 2, 0, t.RGBA, t.FLOAT, new Float32Array([2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]));
                    var r = t.createProgram(),
                    i = t.createShader(t.VERTEX_SHADER),
                    n = t.createShader(t.FRAGMENT_SHADER);
                    return t.shaderSource(i, "attribute vec2 vertex;void main(){gl_Position=vec4(vertex,0.0,1.0);}"),
                    t.shaderSource(n, "uniform sampler2D texture;void main(){gl_FragColor=texture2D(texture,vec2(0.5));}"),
                    t.compileShader(i),
                    t.compileShader(n),
                    t.attachShader(r, i),
                    t.attachShader(r, n),
                    t.linkProgram(r),
                    i = t.createBuffer(),
                    t.bindBuffer(t.ARRAY_BUFFER, i),
                    t.bufferData(t.ARRAY_BUFFER, new Float32Array([0, 0]), t.STREAM_DRAW),
                    t.enableVertexAttribArray(0),
                    t.vertexAttribPointer(0, 2, t.FLOAT, !1, 0, 0),
                    i = new Uint8Array(4),
                    t.useProgram(r),
                    t.viewport(0, 0, 1, 1),
                    t.bindTexture(t.TEXTURE_2D, e),
                    t.drawArrays(t.POINTS, 0, 1),
                    t.readPixels(0, 0, 1, 1, t.RGBA, t.UNSIGNED_BYTE, i),
                    127 === i[0] || 128 === i[0]
                }
                function e() {}
                function r(t) {
                    return "OES_texture_float_linear" === t ? (void 0 === this.$OES_texture_float_linear$ && Object.defineProperty(this, "$OES_texture_float_linear$", {
                        enumerable: !1,
                        configurable: !1,
                        writable: !1,
                        value: new e
                    }), t = this.$OES_texture_float_linear$) : t = o.call(this, t),
                    t
                }
                function i() {
                    var t = a.call(this);
                    return - 1 === t.indexOf("OES_texture_float_linear") && t.push("OES_texture_float_linear"),
                    t
                }
                try {
                    var n = document.createElement("canvas").getContext("experimental-webgl")
                } catch(t) {}
                if (n && -1 === n.getSupportedExtensions().indexOf("OES_texture_float_linear") && t(n)) {
                    var o = WebGLRenderingContext.prototype.getExtension,
                    a = WebGLRenderingContext.prototype.getSupportedExtensions;
                    WebGLRenderingContext.prototype.getExtension = r,
                    WebGLRenderingContext.prototype.getSupportedExtensions = i
                }
            } ();
            var O;
            N.canvas = function() {
                var t = document.createElement("canvas");
                try {
                    O = t.getContext("experimental-webgl", {
                        premultipliedAlpha: !1
                    })
                } catch(t) {
                    O = null
                }
                if (!O) throw "This browser does not support WebGL";
                return t._ = {
                    gl: O,
                    isInitialized: !1,
                    texture: null,
                    spareTexture: null,
                    flippedShader: null
                },
                t.texture = c(r),
                t.draw = c(n),
                t.update = c(o),
                t.replace = c(s),
                t.contents = c(h),
                t.getPixelArray = c(l),
                t.brightnessContrast = c(p),
                t.hexagonalPixelate = c(M),
                t.hueSaturation = c(b),
                t.colorHalftone = c(A),
                t.triangleBlur = c(S),
                t.unsharpMask = c(R),
                t.perspective = c(k),
                t.matrixWarp = c(z),
                t.bulgePinch = c(L),
                t.tiltShift = c(_),
                t.dotScreen = c(P),
                t.edgeWork = c(B),
                t.lensBlur = c(E),
                t.zoomBlur = c(F),
                t.noise = c(y),
                t.denoise = c(v),
                t.curves = c(m),
                t.swirl = c(U),
                t.ink = c(I),
                t.vignette = c(C),
                t.vibrance = c(T),
                t.sepia = c(w),
                t.colorize = c(D),
                t
            },
            N.splineInterpolate = x;
            var G = function() {
                function t(t, e) {
                    var r = O.createShader(t);
                    if (O.shaderSource(r, e), O.compileShader(r), !O.getShaderParameter(r, O.COMPILE_STATUS)) throw "compile error: " + O.getShaderInfoLog(r);
                    return r
                }
                function e(e, n) {
                    if (this.texCoordAttribute = this.vertexAttribute = null, this.program = O.createProgram(), e = e || r, n = n || i, n = "precision highp float;" + n, O.attachShader(this.program, t(O.VERTEX_SHADER, e)), O.attachShader(this.program, t(O.FRAGMENT_SHADER, n)), O.linkProgram(this.program), !O.getProgramParameter(this.program, O.LINK_STATUS)) throw "link error: " + O.getProgramInfoLog(this.program)
                }
                var r = "attribute vec2 vertex;attribute vec2 _texCoord;varying vec2 texCoord;void main(){texCoord=_texCoord;gl_Position=vec4(vertex*2.0-1.0,0.0,1.0);}",
                i = "uniform sampler2D texture;varying vec2 texCoord;void main(){gl_FragColor=texture2D(texture,texCoord);}";
                return e.prototype.destroy = function() {
                    O.deleteProgram(this.program),
                    this.program = null
                },
                e.prototype.uniforms = function(t) {
                    O.useProgram(this.program);
                    for (var e in t) if (t.hasOwnProperty(e)) {
                        var r = O.getUniformLocation(this.program, e);
                        if (null !== r) {
                            var i = t[e];
                            if ("[object Array]" == Object.prototype.toString.call(i)) switch (i.length) {
                            case 1:
                                O.uniform1fv(r, new Float32Array(i));
                                break;
                            case 2:
                                O.uniform2fv(r, new Float32Array(i));
                                break;
                            case 3:
                                O.uniform3fv(r, new Float32Array(i));
                                break;
                            case 4:
                                O.uniform4fv(r, new Float32Array(i));
                                break;
                            case 9:
                                O.uniformMatrix3fv(r, !1, new Float32Array(i));
                                break;
                            case 16:
                                O.uniformMatrix4fv(r, !1, new Float32Array(i));
                                break;
                            default:
                                throw "dont't know how to load uniform \"" + e + '" of length ' + i.length
                            } else {
                                if ("[object Number]" != Object.prototype.toString.call(i)) throw 'attempted to set uniform "' + e + '" to invalid value ' + (i || "undefined").toString();
                                O.uniform1f(r, i)
                            }
                        }
                    }
                    return this
                },
                e.prototype.textures = function(t) {
                    O.useProgram(this.program);
                    for (var e in t) t.hasOwnProperty(e) && O.uniform1i(O.getUniformLocation(this.program, e), t[e]);
                    return this
                },
                e.prototype.drawRect = function(t, e, r, i) {
                    var n = O.getParameter(O.VIEWPORT);
                    e = void 0 !== e ? (e - n[1]) / n[3] : 0,
                    t = void 0 !== t ? (t - n[0]) / n[2] : 0,
                    r = void 0 !== r ? (r - n[0]) / n[2] : 1,
                    i = void 0 !== i ? (i - n[1]) / n[3] : 1,
                    null == O.vertexBuffer && (O.vertexBuffer = O.createBuffer()),
                    O.bindBuffer(O.ARRAY_BUFFER, O.vertexBuffer),
                    O.bufferData(O.ARRAY_BUFFER, new Float32Array([t, e, t, i, r, e, r, i]), O.STATIC_DRAW),
                    null == O.texCoordBuffer && (O.texCoordBuffer = O.createBuffer(), O.bindBuffer(O.ARRAY_BUFFER, O.texCoordBuffer), O.bufferData(O.ARRAY_BUFFER, new Float32Array([0, 0, 0, 1, 1, 0, 1, 1]), O.STATIC_DRAW)),
                    null == this.vertexAttribute && (this.vertexAttribute = O.getAttribLocation(this.program, "vertex"), O.enableVertexAttribArray(this.vertexAttribute)),
                    null == this.texCoordAttribute && (this.texCoordAttribute = O.getAttribLocation(this.program, "_texCoord"), O.enableVertexAttribArray(this.texCoordAttribute)),
                    O.useProgram(this.program),
                    O.bindBuffer(O.ARRAY_BUFFER, O.vertexBuffer),
                    O.vertexAttribPointer(this.vertexAttribute, 2, O.FLOAT, !1, 0, 0),
                    O.bindBuffer(O.ARRAY_BUFFER, O.texCoordBuffer),
                    O.vertexAttribPointer(this.texCoordAttribute, 2, O.FLOAT, !1, 0, 0),
                    O.drawArrays(O.TRIANGLE_STRIP, 0, 4)
                },
                e.getDefaultShader = function() {
                    return O.defaultShader = O.defaultShader || new e,
                    O.defaultShader
                },
                e
            } ();
            d.prototype.interpolate = function(t) {
                for (var e = 0,
                r = this.ya.length - 1; 1 < r - e;) {
                    var i = r + e >> 1;
                    this.xa[i] > t ? r = i: e = i
                }
                var i = this.xa[r] - this.xa[e],
                n = (this.xa[r] - t) / i;
                return t = (t - this.xa[e]) / i,
                n * this.ya[e] + t * this.ya[r] + ((n * n * n - n) * this.y2[e] + (t * t * t - t) * this.y2[r]) * i * i / 6
            };
            var X = function() {
                function t(t, e, r, i) {
                    this.gl = O,
                    this.id = O.createTexture(),
                    this.width = t,
                    this.height = e,
                    this.format = r,
                    this.type = i,
                    O.bindTexture(O.TEXTURE_2D, this.id),
                    O.texParameteri(O.TEXTURE_2D, O.TEXTURE_MAG_FILTER, O.LINEAR),
                    O.texParameteri(O.TEXTURE_2D, O.TEXTURE_MIN_FILTER, O.LINEAR),
                    O.texParameteri(O.TEXTURE_2D, O.TEXTURE_WRAP_S, O.CLAMP_TO_EDGE),
                    O.texParameteri(O.TEXTURE_2D, O.TEXTURE_WRAP_T, O.CLAMP_TO_EDGE),
                    t && e && O.texImage2D(O.TEXTURE_2D, 0, this.format, t, e, 0, this.format, this.type, null)
                }
                function e(t) {
                    return null == r && (r = document.createElement("canvas")),
                    r.width = t.width,
                    r.height = t.height,
                    t = r.getContext("2d"),
                    t.clearRect(0, 0, r.width, r.height),
                    t
                }
                t.fromElement = function(e) {
                    var r = new t(0, 0, O.RGBA, O.UNSIGNED_BYTE);
                    return r.loadContentsOf(e),
                    r
                },
                t.prototype.loadContentsOf = function(t) {
                    this.width = t.width || t.videoWidth,
                    this.height = t.height || t.videoHeight,
                    O.bindTexture(O.TEXTURE_2D, this.id),
                    O.texImage2D(O.TEXTURE_2D, 0, this.format, this.format, this.type, t)
                },
                t.prototype.initFromBytes = function(t, e, r) {
                    this.width = t,
                    this.height = e,
                    this.format = O.RGBA,
                    this.type = O.UNSIGNED_BYTE,
                    O.bindTexture(O.TEXTURE_2D, this.id),
                    O.texImage2D(O.TEXTURE_2D, 0, O.RGBA, t, e, 0, O.RGBA, this.type, new Uint8Array(r))
                },
                t.prototype.destroy = function() {
                    O.deleteTexture(this.id),
                    this.id = null
                },
                t.prototype.use = function(t) {
                    O.activeTexture(O.TEXTURE0 + (t || 0)),
                    O.bindTexture(O.TEXTURE_2D, this.id)
                },
                t.prototype.unuse = function(t) {
                    O.activeTexture(O.TEXTURE0 + (t || 0)),
                    O.bindTexture(O.TEXTURE_2D, null)
                },
                t.prototype.ensureFormat = function(t, e, r, i) {
                    if (1 == arguments.length) {
                        var n = arguments[0];
                        t = n.width,
                        e = n.height,
                        r = n.format,
                        i = n.type
                    }
                    t == this.width && e == this.height && r == this.format && i == this.type || (this.width = t, this.height = e, this.format = r, this.type = i, O.bindTexture(O.TEXTURE_2D, this.id), O.texImage2D(O.TEXTURE_2D, 0, this.format, t, e, 0, this.format, this.type, null))
                },
                t.prototype.drawTo = function(t) {
                    if (O.framebuffer = O.framebuffer || O.createFramebuffer(), O.bindFramebuffer(O.FRAMEBUFFER, O.framebuffer), O.framebufferTexture2D(O.FRAMEBUFFER, O.COLOR_ATTACHMENT0, O.TEXTURE_2D, this.id, 0), O.checkFramebufferStatus(O.FRAMEBUFFER) !== O.FRAMEBUFFER_COMPLETE) throw Error("incomplete framebuffer");
                    O.viewport(0, 0, this.width, this.height),
                    t(),
                    O.bindFramebuffer(O.FRAMEBUFFER, null)
                };
                var r = null;
                return t.prototype.fillUsingCanvas = function(t) {
                    return t(e(this)),
                    this.format = O.RGBA,
                    this.type = O.UNSIGNED_BYTE,
                    O.bindTexture(O.TEXTURE_2D, this.id),
                    O.texImage2D(O.TEXTURE_2D, 0, O.RGBA, O.RGBA, O.UNSIGNED_BYTE, r),
                    this
                },
                t.prototype.toImage = function(t) {
                    this.use(),
                    G.getDefaultShader().drawRect();
                    var i = 4 * this.width * this.height,
                    n = new Uint8Array(i),
                    o = e(this),
                    a = o.createImageData(this.width, this.height);
                    O.readPixels(0, 0, this.width, this.height, O.RGBA, O.UNSIGNED_BYTE, n);
                    for (var s = 0; s < i; s++) a.data[s] = n[s];
                    o.putImageData(a, 0, 0),
                    t.src = r.toDataURL()
                },
                t.prototype.swapWith = function(t) {
                    var e;
                    e = t.id,
                    t.id = this.id,
                    this.id = e,
                    e = t.width,
                    t.width = this.width,
                    this.width = e,
                    e = t.height,
                    t.height = this.height,
                    this.height = e,
                    e = t.format,
                    t.format = this.format,
                    this.format = e
                },
                t
            } (),
            W = "float random(vec3 scale,float seed){return fract(sin(dot(gl_FragCoord.xyz+seed,scale))*43758.5453+seed);}";
            return N
        } ()
    }
});